I was wondering if there is any way to execute a binary in linux, always with a specific flag.
For example, whenever
Yep! What you're looking for is a Bash
alias genisoimage="genisoimage -allow-limited-size" to your
~/.bash_profile for macOS) file.
For more info on the Bash alias, check out http://www.tldp.org/LDP/abs/html/aliases.html?cachebusterTimestamp=1466192028407
EDIT: Given that another script or application calls
If it's being called form another script or application, you're going to have to change the
genisoimage that's resolved within that script/application. Here's how you may be able to accomplish this.
First, Create your own
genisoimage which adds your
-allow-limited-size flag. This will go in to a file named
/some/other/path and must be made executable (i.e.
chmod u+x /some/other/path/genisoimage). Suppose that the genuine
genisoimage file is located at
#! /bin/bash /bin/genisoimage -allow-limited-size "$@"
The above adds the desired flag, and passes all arguments along to the origin
Now when you run your script/application, change the
PATH variable so the file you just created is found first.
$> PATH=/some/other/path:$PATH ./APPLICATION