当在Mac终端上运行时,我得到以下错误:
syntax error near unexpected token `('
这是引发错误的行:
set mpr = (cat $dat | grep "256 256 128" |grep ok | awk '{print $8}') echo "found mprages, $mpr"
如何解决这个语法错误?非常感谢!
完整的代码为:
set s = $1
SUBJECTS_DIR= <path>
export SUBJECTS_DIR
set log = $SUBJECTS_DIR/recon-all-commands.log
set dcmdir = <path>
set subjid = echo $s |gawk -F- '{print $2}'
if (-e $dcmdir/$s/scan.log) then
. echo "found scan.log, finding mprages" set dat = $dcmdir/$s/scan.log
else
. echo "no scan.log"
endif
set mpr = (cat $dat | grep "256 256 128" |grep ok | awk '{print $8}') echo "found mprages, $mpr"
echo recon-all -i $dcmdir/$s/$mpr -all -s $subjid >> $log
1条答案
按热度按时间kkbh8khc1#
Shell版本不兼容使用命令
ls -al /bin/sh
获取版本解决方法:
然后选择否或“否”,并确认。