To stop further execution when command fails:
command || exit 0
To continue execution when command fails:
command || true
More Related Contents:
- What is the command used to the below question? [closed]
- find a word from all files excluding 1 directory
- Looping through the content of a file in Bash
- Save modifications in place with awk
- Why should eval be avoided in Bash, and what should I use instead?
- Argument list too long error for rm, cp, mv commands
- Setting an argument with bash [duplicate]
- How to kill a child process after a given timeout in Bash?
- How to kill a process running on particular port in Linux?
- How to generate a core dump in Linux on a segmentation fault?
- What does “&” at the end of a linux command mean?
- Delete empty lines using sed
- How to set environment variable for everyone under my linux system?
- Linux: copy and create destination dir if it does not exist
- Getting a unique id from a unix-like system
- How to Free Inode Usage?
- How to get full path of a file?
- Is it OK to use the same input file as output of a piped command?
- Finding contents of one file in another file
- Difference between Real User ID, Effective User ID and Saved User ID
- How to get the command line args passed to a running process on unix/linux systems?
- Comparing Unix/Linux IPC
- Restarting cron after changing crontab file? [closed]
- How can I copy the output of a command directly into my clipboard?
- Using grep and sed to find and replace a string
- Is there a way to make mv create the directory to be moved to if it doesn’t exist?
- What is file globbing?
- Need to remove the count from the output when using “uniq -c” command
- Creating temporary files in bash
- What is the difference between source and export?