I have a file like this.
rm a.txt
mkdir foo
cp a.doc docs
I am used to xargs but following command is not doing anything.
cat commands.txt | xargs -l1
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you are doing it wrong! if your file is all shell commands, treat it as a shell script.
then on command line ,
chmod u+x commands.txtthe “defacto” naming convention for shell script ends with extension
.sh, although it can be anything. So try to name your script as “.sh” extension