Below is a quick fix to the qcad script (linux, maybe mac also), so that it will work if the qcad command is symlinked to (say) /usr/local/bin or some such location. The short story is to fix as follows:
#OLD
#DIR=${BASH_SOURCE%/*}
#echo DIR=$DIR
#NEW:
FILE=$(readlink -f ${BASH_SOURCE})
DIR=${FILE%/*}
#DEBUG: echo FILE=$FILE DIR=$DIR
Version: qcad-3.27.1
OS: linux ubuntu-21.04, but should apply to any linux
The long story:
Installed from .tar file:
cd /usr/local
tar -ztvf /local/loc1/rpm/qcad-3.27.1-trial-linux-x86_64.tar.gz
tar -zxvf /local/loc1/rpm/qcad-3.27.1-trial-linux-x86_64.tar.gz
/usr/local/qcad-3.27.1-trial-linux-x86_64/qcad WORKS
Try to link qcad into /usr/local/bin
the below symlinks do not work
% ln -s /usr/local/qcad-3.27.1-trial-linux-x86_64/qcad /usr/local/bin
% qcad
/usr/local/bin/qcad: line 11: /usr/local/bin/qcad-bin: No such file or directory
does not help:
ln -s /usr/local/qcad-3.27.1-trial-linux-x86_64/qcad-bin /usr/local/bin
Fatal: This application failed to start because it could not find or load the Qt platform plugin “xcb”
Also tried using hardlink, that does not work either. Try to fix in the qcad script:
#OLD
#DIR=${BASH_SOURCE%/*}
#echo DIR=$DIR
#NEW:
FILE=$(readlink -f ${BASH_SOURCE})
DIR=${FILE%/*}
#DEBUG: echo FILE=$FILE DIR=$DIR
With these changes, the symlink
ln -s /usr/local/qcad-3.27.1-trial-linux-x86_64/qcad /usr/local/bin
will run properly.