Start a new topic
Answered

Parameters for IBShell Scripts

Does anyone know if it's possible to include parameters when executing scripts in the infoburst shell?  With the windows command line, you could call a bat script, followed by arguments which would then be available within the script.  i.e. for the following command:

call command.bat 20170314 Prod

%1 in command.bat would be equal to 20170314 and %2 would be equal to Prod.  

Does the infoburst shell have any similar functionality?


Best Answer

You are the first to request such a feature and thanks for suggesting it.


The Shell does have "variables" which can be defined within a script using the var keyword, and then later used with a $ prefix


For example


var burst = "MyBurst"


new burst name="$burst"


We have added the ability to pass parameters from the command line into our next build (232) which is due out soon.


For example


IBShell hello world


Here you are starting the shell and supplying 2 parameters - these can now be used with %1 and %2 


echo "%1 %2"


We also added the echo command which was listed in the help but never implemented.





1 person has this question

Can you describe the use case? What specifically are you trying to parameterize in the script?

Answer

You are the first to request such a feature and thanks for suggesting it.


The Shell does have "variables" which can be defined within a script using the var keyword, and then later used with a $ prefix


For example


var burst = "MyBurst"


new burst name="$burst"


We have added the ability to pass parameters from the command line into our next build (232) which is due out soon.


For example


IBShell hello world


Here you are starting the shell and supplying 2 parameters - these can now be used with %1 and %2 


echo "%1 %2"


We also added the echo command which was listed in the help but never implemented.





1 person likes this

Awesome, thanks!  This came up because we have a lot of reports that need to have their parameters updated by information from a secondary command-line based system, and it'd be a lot easier to pass in values to the .ibs scripts than it is to generate a new ibs script containing the correct values every time something changes.  

Login or Signup to post a comment