Page 1 of 1

Reading parameter file

Posted: Sun Jan 22, 2017 2:29 pm
by mallikharjuna
hi,

I have created all the parameters in one script ex:param.sh, i want to use this parameter script in my main script, please let me know the execution command for executing dsjob with these parameter script

Posted: Sun Jan 22, 2017 10:46 pm
by ray.wurlod
An Internet search for "dsjob parameter file" will yield many hits. The easiest solution is to have your file set up as a values file for a Parameter Set that every job uses, then the values (as defined) are automatically picked up and used, or can be overridden using setname.parametername=value dot notation if required in the dsjob command.

If you don't want to do that, and your parameters file is arranged as name=value pairs, then you can use grep to extract the appropriate line. Enclose each grep command in backquotes within the dsjob command. For example

Code: Select all

dsjob -run -param `grep myparam param.sh | tr -d \n` projectname jobname

Posted: Mon Jan 23, 2017 6:55 am
by chulett
:?: Can you clarify what you mean when you say "created all the parameters in one script ex:param.sh"?

A shell script that "creates parameters" would typically mean sets up environment variables (using 'set') which jobs built to do so would use. If it is meant to be a parameter value file and is more of a simple text file - rather than a true shell script - with the name/value pairs that Ray mentioned then he's given you a couple of ideas there. If you still need help with this I'd suggest the clarification requested above be attempted.