unix - How to run a tcsh shell command and selectively ignore the status? -


I have a TCS shell script which I want to stop at the most time with an error on the nonzero situation, But in some cases I want to ignore it. For example:

  #! / Bin / tcsh -vxef cp file / that / maybe / does not exist # This status to ignore the CP file / that / maybe / does not exist /; Echo "This does not work" is a CP file / that / should / exists # if this condition is noose, then  
"post-text" itemprop = "text">

to stop it Do not know about TCS, but with Bash, you can use it to do this. When the -e flag is set, the bash will exit immediately if any sub command fails (see manual for technical details). If not set, it will continue to execute. So, you can do something like this:

  set + e cp file / that / may / not / exist # script error set-A cp file / that / maybe / not / exist Regardless, keep moving. # Scripts will exit "this line has not reached"  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -