Executable lauches if called directly from terminal, but does not work when called from shell script

Solution 1:

Setting directory variable like this:

export set SAMTOOLS_DIR="/home/laba/Desktop/samtools/samtools-1.1"

And then calling the exacutable from the script like this:

$SAMTOOLS_DIR/samtools [parameters]

solves the problem