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
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
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
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
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
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
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
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
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
LEARN ABOUT FREEBSD
gpioctl
GPIOCTL(1) BSD General Commands Manual GPIOCTL(1)
NAME
gpioctl -- GPIO control utility
SYNOPSIS
gpioctl -l [-f ctldev] [-v]
gpioctl -t [-f ctldev] pin
gpioctl -c [-f ctldev] pin flag [flag ...]
gpioctl [-f ctldev] pin [0|1]
DESCRIPTION
The gpioctl utility could be used to manage GPIO pins from userland and list available pins.
The options are as follows:
-c pin flag [flag ...]
Configure pin by setting provided flags. The following flags are currently defined:
IN Input pin
OUT Output pin
OD Open drain pin
PP Push pull pin
TS Tristate pin
PU Pull-up pin
PD Pull-down pin
II Inverted input pin
IO Inverted output pin
-f ctldev GPIO controller device to use If not specified, defaults to /dev/gpioc0
-l list available pins
-t pin toggle value of provided pin number
-v be verbose: for each listed pin print current configuration
EXAMPLES
o List pins available on GPIO controller defined by device /dev/gpioc0
gpioctl -f /dev/gpioc0 -l
o Set the value of pin 12 to 1
gpioctl -f /dev/gpioc0 12 1
o Configure pin 12 to be input pin
gpioctl -f /dev/gpioc0 -c 12 IN
SEE ALSO
gpio(4), gpioiic(4), gpioled(4)
HISTORY
The gpioctl utility appeared in FreeBSD 9.0.
AUTHORS
The gpioctl utility and this manual page were written by Oleksandr Tymoshenko <gonzo@freebsd.org>.
BSD
November 7, 2013 BSD