I am new to script writing. I have encountered the mentioned in the title i.e ‘Syntax error at line 131 : “’ is not matched.’ . The code at line 131 is commented out. I think the line below might be causing the problem. Could anyone direct me how the code below should be written? I need to output the value of scp and ssh command to determine whether the code was succesfully executed.
scpstat=`echo scp $INPUTDIR/work_dir/$f $EUSER@$ESCSYS:$EDIR/build/. |
ssh $EUSER@$ECSYS "chmod 660 $EDIR/build/$f;chgrp 107 $EDIR/build/$f;chown 103 $ESCDIR/build/$f;rename $ESCDIR/build/$f $ESCDIR/work/$f"'
status=$?
It looks to me like the ` (backtick) before
echois not matched, as the error suggests. It looks like the ‘ (apostrophe) at the end of the second line should be a backtick instead.Some people think it’s better style to use
$(...)rather than `…`, and this is surely a good example of why.