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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -