mrcore
wiki
Search
Loading Search ...
Post Files
Post
#
226 Info
View Simple
View Raw
Sign In
Sed Command
Post
#226
by mreschke 2010-12-06 16:40:02 updated by mreschke 2014-09-29 14:16:00 (3269 views)
shell
scripts
snippets
Post Content
One Liners
See Also
Awk Command
and
Grep Command
One Liners
[-]
[--]
[++]
Replace all occurrence's in a file (and write back to the same file)
sed -i "s/this/withthis/g" /tmp/somefile
Replace output newline (carriage return) with
<br />
sed ':a;N;$!ba;s/\n/ /g'
emailbody="<h2>Your Directory</h2><pre>`/bin/ls -Rhal $yourdir|sed ':a;N;$!ba;s/\n/<br\/>/g'`</pre>"