I am trying to write a bash script to do a batch processing of some fMRI data. My problem is that I am not able to get the filenames that match a specific pattern within the directory of interest.
My scripts looks like this
#!/bin/bash
inputpath="/Volumes/External_HD/Experiments/MRI_Data"
outputpath="/Volumes/External_HD/Experiments/MRI_Data_output"
anatomical_scans=$find `$inputpath` -name *mprage
# RUN BET
bet $anatomical_scans $outputpath
echo 'Finished!!!'
The only output that I get is the following error message
-name: command not found
I am definetely not familiar with shell scripting so I am sorry if the question may sound trivial. Any help will be much appreciated.
Antonio
EDIT:: SOLVED
Exploring the suggestions I found the correct way to make it running with no errors
anatomical_scans=$(find $input_path -name "*mprage*")
Thanks
#!/bin/bash. AND avoid the top 10 shell script beginner mistakes by reading stackoverflow.com/tags/bash/info multiple times. Good luck.