Tutorial by Examples

Note: For brevity, the commands use here-strings (<<<) and ANSI C-quoted strings ($'...'). Both these shell features work in bash, ksh, and zsh. # GNU Sed $ sed ':a;$!{N;ba}; s/\n/\t/g' <<<$'line_1\nline_2\nline_3' line_1 line_2 line_3 # BSD Sed equivalent (multi-line form) ...
Note: For brevity, the commands use here-strings (<<<) and ANSI C-quoted strings ($'...'). Both these shell features work in bash, ksh, and zsh. # GNU Sed $ sed '1 a appended text' <<<'line 1' line 1 appended text # BSD Sed (multi-line form) sed '1 a\ appended text'...

Page 1 of 1