I am trying to use git for the first time and have been given some code to extract a file name from a MatLab script. I keep encountering this error, and if I remove the bracket after imread it does not complete the command and gives another line to keep writing. I have also tried closing the bracket at various points along the remainder of the line but this produces the same issue. Is anything obviously wrong here?
cat NimStim_Task.m | grep "NimStim" | grep -v "_t[0-9]" | tr "\\\" "/" | tr "'" " " | sed 's~ *prime = imread(\[cd /NimStim/\([^ ]*\)\.bmp.*stim = \([0-9]*\).*~\1, \2~g')) > stimulusNames_numbers.csv