![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem with output of find command being input to basename command... | new_learner | UNIX for Dummies Questions & Answers | 2 | 12-14-2008 02:56 AM |
| awk/sed Command : Parse parameter file / send the lines to the ksh export command | rajan_san | Shell Programming and Scripting | 4 | 11-06-2008 01:29 PM |
| assign a command line argument and a unix command to awk variables | sweta_doshi | Shell Programming and Scripting | 0 | 08-08-2008 07:54 AM |
| Help Required: Command to find IP address and command executed of a user | loggedout | Security | 2 | 08-06-2008 09:12 PM |
| inconsistent ls command display at the command prompt & running as a cron job | rajranibl | SuSE | 5 | 07-30-2007 09:26 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
sed -e command
I understand that "-e" is to be used in sed to run multiple commands.
I have seeing examples of sed -e command on the web. Some are like : - sed -e 's/a/A/g' -e 's/b/B/g' 1.txt where "-e" comes multiple times as "-e" is to be used to apply multiple commands on the input. In the above example we need to perform two replacements - a with A and b with B hence two "-e" are used. But I have also seen lot of examples on the web where single "-e" is being used. Some of these are : sed -e 's/^#.*//' f1 f2 f3 | grep -v '^$' | wc -l sed -e '/^[ ]*$/d' InputFile >OutputFile These examples can be used to achieve the exact same purpose even without using "-e". Can someone explain, then why do we intend to use "-e" in such cases. Please let me know if I am missing out something on understanding the purpose of "-e". Thanks |
|
||||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|