![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Command line not getting assigned in script. | Veenak15 | Shell Programming and Scripting | 3 | 08-05-2009 06:26 AM |
| small doubt reg uname command | rogerben | SUN Solaris | 1 | 02-20-2009 08:11 PM |
| cat in the command line doesn't match cat in the script | shira | Shell Programming and Scripting | 21 | 01-28-2009 11:15 AM |
| Script through cron and command line | rahulrathod | UNIX for Dummies Questions & Answers | 3 | 02-22-2008 07:10 AM |
| command line work script doesn't | larry | Shell Programming and Scripting | 2 | 08-27-2003 02:33 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
small sed script on command line.
Can anyone help me get this small sed script to work in shell on the command line?
I need it in a one liner really as i want to edit many scripts in a for loop and dont want to have to invoke a separate script each time. Code:
#!/bin/sh
sed '/mailx\ -s.*$ {
i\
#Comment above mailx line
c\
mailx -s "blahblah blah my new subject" $someone_who_cares
}' $1
I've tried the following and no joy Code:
sed '/mailx\ -s.*$/ { i\ #Comment above mailx line c\ mailx -s "blahblah blah my new subject" $someone_who_cares }' file > file2
sed '/mailx\ -s.*$/ {; i\; #Comment above mailx line ;c\; mailx -s "blahblah blah my new subject" $someone_who_cares ;};' file > file2
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|