I have a neuroimaging script that uses a command called mat2det. Example shown bellow:
eTIV=`./mat2det data_path/subject_T_brain.mat | awk '{ print $2 }'`
This mat2det command is coded like this:
#!/bin/awk -f
BEGIN { i=0; } {
if (i==0) {a=$1;b=$2;c=$3; i=i+1;} else
if (i==1) {d=$1;e=$2;f=$3; i=i+1;} else
if (i==2) {g=$1;h=$2;I=$3; i=i+1;} }
END {
det=a*e*I+b*f*g+c*d*h-a*f*h-b*d*I-c*e*g;
printf("%f\t%f\n",det,1/det);}
Whenever I try to run ./mat2det, it fails, giving me the error message:
bash: ./mat2det: /bin/awk: bad interpreter: No such file or directory
The file has full permissions, via chmod 755 and I'm unsure why this is the case. Does anyone know why this might be the case?
Apologies for my ignorance around the topic and if I haven't explained this issue well.
Thanks!