So I'm trying to execute a command in a bash script multiple times with different but same number of arguments while redirecting the output to a text file. For example ...
./test arg1 arg2 arg3 >> output.txt
This works if I do it at the command line. In a script where I have...
command ./test 10 5 option1 >> output.txt
command ./test 5 10 option2 >> output.txt
And run the script, I get command not found
. If I remove the redirect to ouput.txt, the script then works / prints to the terminal window
I tried searching online but I could not find examples where arguments were used which then redirected
Anyone able to help?
The issue had to do with writing the script in Windows in Sublime Text and then transferring it to a Linux server. Switching the mode in Sublime Text made the difference
Videonauth also pointed out that I should have just one redirect symbol ">" since for the first line since it is a new file
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加