I'm writing a bash script Test.sh
that aims to execute anotherscript
(a linux executable file):
#!/bin/bash -l
mp1='/my/path1/'
mp2='/my/path2/anotherscript'
for myfile in $mp1*.txt; do
echo "$myfile"
"$mp2 $myfile -m mymode"
echo "finished file"
done
Notice that anotherscript
takes as arguments $myfile
and options -m mymode
.
But I get the file not found error (says Test.sh: line 8: /my.path2/anotherscript: No such file or directory
).
My questions are:
- I have followed this question to get my bash script to run the executable file. But I'm afraid I still get the error above.
- Am I specifying arguments as they should to execute the file?