For the following example we need a bash script to test the exec*() function.
In /home/bernd/bin2 stand the bash script „test.sh“ with the following content:
#!/bin/bash
script_name=$0
arg1=$1
current=`pwd`
echo $script_name, $arg1
echo "XYZ: "$XYZ
echo "PATH: "$PATH
echo "current directory: $current"
Attention:
test.sh has to be executable and bin2 shouldn't be in $PATH.