shell - Read commands from text file and run it in Qshell -
i have file has commands written in lines. need read file , run commands written in in qshell. know can : ls < test.txt
not documentation < command. please let me know if there other better way .
the qsh utility accepts command file parameter , runs commands contained in file.
qsh test.txt
<
standard redirection operator.
ls utility not process stdin example list specific files not work way expect.
the xargs utility execute specified command (utility) parameters stdin.
xargs ls < test.txt
assuming test.txt contains following lines:
a
b
c
it execute following command:
ls b c
you can limit number of parameters -n parameter.
xargs -n 1 ls < test.txt
this execute following individual commands:
ls ls b ls c
Comments
Post a Comment