Sponsored Content
Top Forums Shell Programming and Scripting Awk script with a urgent requirement Post 302319333 by kshitij on Monday 25th of May 2009 04:42:30 AM
Old 05-25-2009
awk '/PIN1/{f=1}f && /}/{print;system("cat insert_code");f=0;next}1' FILE > newfile

I tried with this but the Problem is the code is getting inserted like this

pin (PIN1 )
...
...
max_tran ...
}

insert_code file contents

actually it should be like this

pin (PIN1)

..

..

max_tran

insert_code file content

}

the insert_code file content has been modified and flags have been added with # so that we can match the pattersn which are with # and rest of the code will be inserted in the file 1 contents

Right now insert_code is getting inserted in the file 1 along with the keywords # which I need to avoid

Thanks and Regards
Kshitij Kulshreshtha
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help in writing awk script, plz urgent

I have a file like this I have to I have input file this , I want to give the out put in the below input file (NARAYANA 1 ENDING AT (100, 16383) ,NARAYANA 2 ENDING AT (100, 32766) ,NARAYANA 3 ENDING AT (100, 49149) ,NARAYANA 4 ENDING AT (100, 65535) ,NARAYANA 5... (8 Replies)
Discussion started by: LAKSHMI NARAYAN
8 Replies

2. Shell Programming and Scripting

Required Shell script for My requirement

Hi All, I joined today in this forum to have all of your help. I have a Big requirement, pls. help me to resolve. I'm using HP-UX 11.23. I need a shell script for the following requirement. I have a file (nodes.txt) that contains 1000 nodes. I'm running the following command:... (3 Replies)
Discussion started by: ntgobinath
3 Replies

3. Shell Programming and Scripting

urgent help awk script

Hi I have a scenario where i have a file name as abcd_To_hfgh.20090456778_1.dat I will get the filename as parameter and i need a string in between second _ and first . i.e i need hfgh in this case. Please help me with the script. This may not be awk script even if it can be... (2 Replies)
Discussion started by: dsdev_123
2 Replies

4. Shell Programming and Scripting

URGENT REQUIREMENT

1.Write an automated shell program(s) that can create, monitor the log files and report the issues for matching pattern. (i) Conditions for creating log files. Log file is created with date (example 2010_03_27.log). If the log file size is 10 Mb for a particular day then automatically the log... (3 Replies)
Discussion started by: praveen12
3 Replies

5. Shell Programming and Scripting

How to write bash shell script for mentioned requirement?

Hi All, I am unable to write the script for the below requirement. Requirement: Main table dir_ancillary table contain three column "dir_ancillary.table_name"," dir_ancillary.text_file_name ", "dir_ancillary.Include" . This dir_ancillary contain undefined tables in the column... (2 Replies)
Discussion started by: Vineeta Nigam
2 Replies

6. Shell Programming and Scripting

Help to write a script for the below requirement

Hi, I am not so familiar with shell Script but I have a task in hand. So, here it goes: There is a file details.txt in the server where the below details are stored: Name Country D M Acc.No. sameer India 30 july sscc-errttt-q random US 20 july pecc-ttt4-s Deb India 31... (3 Replies)
Discussion started by: neel87
3 Replies

7. UNIX for Dummies Questions & Answers

Script requirement

Please help in creating script for below requirement. I will be running 1 command and will get below entries in a text file say file44.txt ******************************* DFDL1005 06:30 00:05 ABFL2003 10/22 01:10 CFTL1256 10/24 00:10 10/25 09:20 PM ******************************** .... (3 Replies)
Discussion started by: Vinay_3308
3 Replies

8. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies
PIN(1)							      General Commands Manual							    PIN(1)

NAME
pin - Package InformatioN SYNOPSIS
pin [OPTION] [PACKAGENAME/FILE] DESCRIPTION
Pin searches the installed packages (rpm -qi, -ql) and/or the ARCHIVES.gz file for the desired information. It shows also README, README.SuSE, FAQ, when available. It is also possible to search through different version with the -v option, if you have the ARCHIVES.gz from it. You have to copy AR- CHIVES.gz to /var/lib/pin/ for this option, don`t forget to name it, e.g. 7.1-ppc, 7.2-i386. pin open a dialog box and wait for searchstring pin <name> searches for a package <name> pin -f <name> greping also if package was found pin -v <version> <name> searches through another version, not the default AUTHOR
Written by Martin Lasarsch REPORTING BUGS
Report bugs to <mlasars@suse.de> CREDITS
thanks to henne <scripts@hennevogel.de> for hosting & advertising and Stefan Schmidt for better sorting. Christian Boltz for testing, fixes and recommendations. COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA pin September 2001 PIN(1)
All times are GMT -4. The time now is 05:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy