FEAT unrecognized by BASH, but works as GUI and in command line

Hi all, I’m having a hell of a time trying to just get feat to work within a simple shell script (Added below, just in case I’m doing something dumb). feat works perfectly fine from the GUI, and even if I feed feat an .fsf file through the command line. However, through bash, I get a simple error message:

feat: command could not be found

This sounded like a PATH issue to me, so I double-check both .bashrc and .profile and, sure enough, had the fsl path defined in both. echo $PATH suggests fsl is working fine:

echo $PATH
/usr/local/fsl/bin:usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

I reinstalled fsl again after that. I also ran it as sudo and I ensured I had the proper permissions to read write and execute in all relevant directories using chmod, and still nothing. In addition, I also tried running the feat command with an fsl6.0- prefix because I found that mentioned in a Stack Overflow thread.

Any ideas? Any advice is highly appreciated!

# Creating a for-loop to cycle through participants
for ID in ${SUBJECTS} ; do

    SUBJ="sub-${ID}"

    # Specifying Directory
    cd
    echo "===> Starting processing of ${SUBJ}"

    # DERIV is the output for our preprocessed data
    cd ${DERIV}/pipeline_0/fmriprep/${SUBJ}

    # Creating a folder for each participant to house .fsf's
    sudo mkdir DesignFiles
    cd DesignFiles

        # Creating a for-loop to cycle through runs
        # NRUNS defines the number of runs in dataset
        for RUN in `seq -w 1 ${NRUNS}` ; do
            
            # Copy the design files into the subject directory to be modified
            cp ../../../../../rawdata/code/DesignFiles/design_run${RUN}.fsf \
            design_run${RUN}.fsf

            # Replacing subject ID in each file
            # We are using the | character to delimit the patterns
            sed -i "s|CU10978|${ID}|g" design_run${RUN}.fsf
                
            # Now everything is set up to run feat
            feat design_run${RUN}.fsf     
                       
        done         
        echo

done
echo

Can you run feat by using the full path? E.g. /usr/local/fsl/bin/feat design_run${RUN}.fsf ? Is the environment variable $FSLDIR defined?

1 Like

Hey Steven,

It seems like that might have been the ticket (defining the full path to feat). I’m honestly not sure why it was necessary, given that $FSLDIR looks like it was defined and within the PATH, but I’m a Linux novice so it’s reasonable I’m missing something. I’m not even going to worry about it now; just happy it’s working.

I got it going about 2 hrs ago but it seems like it’s still chugging through it, based on the active tasks I can see using htop , so I won’t be sure until that finishes up.

Thanks so much for the response! Fingers crossed it comes out like it should.