I want to execute a queue of commands in the Mac terminal. Is it possible to prepare a file which contains a series of commands, and to submit the file through the terminal? For example…
commands.txt contains several commands, one per line:
./executable_file -f sub_a 100
./executable_file -f sub_b 100
./executable_file -f sub_c 100
./executable_file -f sub_d 100
...
How can I do that?
Maybe I am misunderstanding you, but this sounds like a typical case of a shell script file.
Create a file “myscript.sh”, add your commands to it. Make the very first line
to tell OS X what to do with the file. Then mark it executable (chmod +x myscript.sh) and run it per ./myscript.sh.
That should do the trick.