When can argv[0] have null?

With the exec class of calls, you specify the program name and program executable separately so you can set it to NULL then. But that quote is actually from the ISO standard (possibly paraphrased) and that standard covers a awfully large range of execution environments from the smallest micro-controller to the latest z10 Enterprise-class mainframe. … Read more

How to access command line arguments of the caller inside a function?

If you want to have your arguments C style (array of arguments + number of arguments) you can use $@ and $#. $# gives you the number of arguments. $@ gives you all arguments. You can turn this into an array by args=(“$@”). So for example: args=(“$@”) echo $# arguments passed echo ${args[0]} ${args[1]} ${args[2]} … Read more

tech