![]() |
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 |
| Replacing the last data of each line ina file | jisha | Shell Programming and Scripting | 6 | 08-04-2008 07:47 AM |
| Replacing end of line with " in a UNIX file | The Observer | Shell Programming and Scripting | 2 | 05-17-2008 05:20 AM |
| replacing a line of unknown charecters in a file | malavm | Shell Programming and Scripting | 12 | 07-26-2007 04:25 AM |
| Replacing characters in file with line break | johnemb | Shell Programming and Scripting | 10 | 04-26-2007 07:38 AM |
| replacing first line or lines in a file | Terrible | UNIX for Advanced & Expert Users | 3 | 06-28-2006 08:23 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Replacing a line in a file - HELP!!!
I have a problem in the following code ...
Code:
while read line do #Get Line Number OLDLINE=`sed -n $Lineno $filename` echo "Un Changed Line : "$OLDLINE echo "Enter a New Pattern : " read NewPattern <&1 echo "NewPattern :"$NewPattern NEWLINE=`cat $filename | sed -n $Lineno | sed s/$OldPattern/$NewPattern/` echo $NEWLINE LINECHANGE=`sed s/$OLDLINE/$NEWLINE/ $filename` echo $LINECHANGE ChangedLine=`sed -n $Lineno $filename` echo "Changed Line : "$ChangedLine done < $INT_FILE OLD line with the NEW line. I have problem in the following line Code:
LINECHANGE=`sed s/$OLDLINE/$NEWLINE/ $filename` is there any problem with the command i gave or should i need to correct it Can anyone please help. Thanks Rahul Last edited by Yogesh Sawant; 06-05-2008 at 01:06 AM.. Reason: added code tags |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|