There are script
/usr/bin/ugene
#!/bin/bash
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/ugene
export LD_LIBRARY_PATH
/usr/lib64/ugene/ugene "$@"
that runs another script
/usr/lib64/ugene/ugene
#!/bin/bash appname=ugenecl # Check if '-ui' parameter is present. # If it does exclude it from the list of parameters # and use ugeneui instead of ugenecl params=() while [[ $# -gt 0 ]]; do if [ "$1" = "-ui" ]; then appname=ugeneui else params+=("$1") fi shift done dirname=$(dirname `readlink -f $0`) tmp="${dirname#?}" if [ "${dirname%$tmp}" != "/" ]; then dirname=$PWD/$dirname fi LD_LIBRARY_PATH=$dirname export LD_LIBRARY_PATH $dirname/$appname "${params[@]}"
Why not to place second script directly in bin?