How to get command-line arguments using a text file? How to get command-line arguments using a text file? linux linux

How to get command-line arguments using a text file?


yes easily using xargs. assume file content is

AB

and the bash script file s content is

echo $1echo $2echo $@

then :

cat file | xargs ./sABA B


If I understand the question correctly, and test.txt contains a list of file names you want to pass to testBash.sh, you should be able to do something like this:

cat test.txt | testBash.sh