utility
sed
Apply stream editing commands. s/pattern/replacement/g substitutes all nonoverlapping matches; normal output is stdout. In-place options vary.
Formal Syntax & Structure
bash syntaxbash
sed SCRIPT [FILE ...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| SCRIPT | string | Trusted sed program, quoted in Bash. |
| FILE | path | Input file or stdin. |
Return Value
exit status
Exit status 0 on success; nonzero indicates failure or a command-specific condition. See description and example.
Working Example
Example Snippetbash
printf '%s\n' 'draft draft' | sed 's/draft/final/g'