Hi all,
I have one query,in my script,i give one input like sectionname that enclose with[] and that will search in specific file in specific directory.If found ,then it's search next [ or eof ,if found,just decrease line no. and insert lines. like example..
in common.cfg file under config directory.i want to insert some parameter's in last of [CHECKPORT] section and begin of [sometext] section ,sometext means different sectionname.
I want to insert parameter's below p3.
I did like this....
this code inside loop.
Thanks
surya
---------- Post updated at 06:52 AM ---------- Previous update was at 05:32 AM ----------
Hi all,
let me revise my query,
Actually :- grep -Fwnx "[CHECKPORT]" common.cfg | cut -d ':' -f1 line of code find the line number of checkport section in common.cfg file and
((N++))---->increase the line number
sed -i"{$N}" 'i\' "common.cfg [CHECKPORT] parameter9" inputfile ,insert parameter.
In this code,it's simply add parameter's in begin of checkport section but i need it should insert at end of section.
Thanks
surya
Last edited by Franklin52; 01-28-2011 at 03:28 AM..
Reason: Please use code tags
Hi Experts,
I need some suggestion on file grep.
I am trying to find multiple pattern with the file grep as below
grep "2013" trace.log | grep -f pattern.cfg -i > $LOG
if ; then
mail -s "Exception" "sample@abc.com" < $LOG
fi
Is it possible to obtain what pattern I got in the... (5 Replies)
Hi,
What does this line do
grep -E 'ORA-' $LIN_TOP/log/status.log > /dev/null 2>&1
Does this check in status.log and in std out, stderr also.?
Thanks (3 Replies)
Hi All,
The result for 'grep "cert_codes" /develop/sales/appl.srce/*.4gl' command will be saved at aa.txt
grep "cert_codes" /develop/sales/appl.srce/*.4gl >aa.txt
But I am not sure, whether, all result stored in .txt file in case of multi-line result.
Please revert back if... (2 Replies)
Hi
please can someone help me with a query?
The following command is executed:
$ ls
abc def hij
You execute the command:
ls | grep f*.
Which files will be displayed and why?
thanks (13 Replies)
As part of my never-ending nagios automation project I am need to implement the following run line into a loop;
-bash-3.00$ grep ${feed} /usr/local/feed/service/clients/*/bin/* | awk -F/ '{print "To restart: /"$2"/"$3"/"$4"/"$5"/"$6"/"$7"/"$8"/"$9}'
Which prints to screen;
To restart:... (3 Replies)
Hi all, I am trying to remove quite a lot of numbers for a file I have which looks something along the lines of;
1,2,3,4,5,6 etc
I have a list of numbers I want removing looking like;
10000
10987
16572
etc
etc
and have been trying to run;
for id in `cat list` ; do sed -i -e... (8 Replies)
Hi
I have file like this:
Sun Jan 24 03:00:00 2010: *** Weekly Process - get_ens_files.pl START ***
Sun Jan 24 03:00:00 2010: *** ***
Sun Jan 24 03:00:00 2010: ***************************************************
Sun Jan 24 03:00:11 2010: ... (2 Replies)
Hai Friends
Can anyone provide me a grep command to print x to y lines in a file.
For example:
grep command to display 15th line to 21st
Thanks in advance
Collins (4 Replies)