我有一个 tcsh shell 脚本,我想在大多数情况下因非零状态错误而停止,但在某些情况下我想忽略它。例如:
#!/bin/tcsh -vxef
cp file/that/might/not/exist . #Want to ignore this status
cp file/that/might/not/exist . ; echo "this doesn't work"
cp file/that/must/exist . #Want to stop if this status is nonzero