Page 1 of 1

Execute Command stage and multiple commands

Posted: Mon Oct 17, 2011 10:30 pm
by fmou
Hi,

How to execute multiple commands using a Execute Command stage?

I see the Execute Command stage requires a command and its parameters. For a complicated command like the following,

Code: Select all

tar cf mytar.tar A.txt B.txt C.txt ; mv sample.html public_html ;chmod go-rwx biglist
what shall I do?

Moreover, can I do piping as well? E.g.,

ls file1* file2* | xargs ... | more piping | commands

Thanks

Posted: Mon Oct 17, 2011 11:26 pm
by ray.wurlod
You can do anything you could do at the operating system shell prompt. Pipelining, redirection... it's all there for you. After all, the stage merely invokes an operating system shell and passes it the command.

Be wary, though, that job parameter references can only appear in the Parameters field, not in the Command field.

Posted: Tue Oct 18, 2011 7:16 am
by fmou
I see the Execute Command stage requires a command and its parameters
I can't view the protected info. Could anyone confirm that I can just put the complicated command in the command entry and leave its parameters blank?

thanks

Posted: Tue Oct 18, 2011 7:20 am
by chulett
Do you need to pass any job parameters to the command? If not, then yes you can leave that part blank. Of course, you could just try it and see what happens.