![]() |
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 |
| Bash script: issue changing directories in script | Breakology | Shell Programming and Scripting | 5 | 05-26-2009 08:47 AM |
| using tar via su in a script issue !!! | kpatel786 | Shell Programming and Scripting | 3 | 07-07-2008 08:13 PM |
| Issue in my script | chiru_h | Shell Programming and Scripting | 4 | 09-27-2006 09:27 AM |
| please help ftp script issue | mgirinath | Shell Programming and Scripting | 4 | 04-28-2006 10:33 AM |
| Issue with sed in script | bthomas | Shell Programming and Scripting | 3 | 04-14-2005 04:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi ,
I am using the below awk script awk '{if($0 ~ /B1/) {set=1; next }; if( $0 ~ /END/) {set = 0}; if (set ) { print }}' CODE | awk '/A \(P1\)/{f=1}f && /}/{print; system("cat $1");f=0;next}1' A.lib > newfile I need to insert code from CODE file into A.lib file A.lib file content is A (P1) { timing : 10; cap : 2; slew : 3; } C (P2) time : 10; cap : 2; slew : 3; } D (P3) time : 11; cap : 4; slew : 6; } A (P1) { time : 16; cap : 4; slew : 7; } I could able to enter the code from CODE file while searching the patterns A (P1) but it is not inserting the code for another Block A (P1) { time : 16; cap : 4; slew : 7; } My issue is with Global Replacement with this script whereever it can find A (P1) it should insert the code from CODE file . I tried to use the g operator but it is not working Please advice in regards with the same Thanks Shalini |
|
||||
|
This is your 3th thread regarding the same question, the 1st thread with the username kshitij.
Please don't double post questions, read the rules. Continue on one of these threads: Sed Script Problem Awk script with a urgent requirement Thread closed! |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|