Exit status (sed, a stream editor)
2.3 Exit status
An exit status of zero indicates success, and a nonzero value indicates failure. GNU
sed returns the following exit status error values:
- Successful completion.
- Invalid command, invalid syntax, invalid regular expression or a GNU
sedextension command used with
- One or more of the input file specified on the command line could not be opened (e.g. if a file is not found, or read permission is denied). Processing continued with other files.
- An I/O error, or a serious processing error during runtime, GNU
Additionally, the commands
Q can be used to terminate
sed with a custom exit code value (this is a GNU
$ echo | sed 'Q42' ; echo $? 42