Linux command: sed

From RHS Wiki
Revision as of 04:17, 7 April 2015 by Rafahsolis (talk | contribs) (Protected "Linux command: sed" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
Jump to navigation Jump to search

The sed command can be used for varius things see man page:
sed command man page
An example of use of sed to replace characters:
echo <string to replace> | sed <regular expression>
Regular expresion:

s -> replace.
g -> all the 'e' are replaced with 'R'. without g only one 'e' is replaced.
# -> delimitation character can be: {|, /, #}.

Example:

echo "esto es un ejemplo" | sed 's#e#R#g'