10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
Discussion started by: vivek d r
1 Replies
2. Shell Programming and Scripting
cat file |grep -v "xx" | grep -v "yy" |grep -v "zz" (3 Replies)
Discussion started by: yanglei_fage
3 Replies
3. Shell Programming and Scripting
Hi,
I am trying to search for a string in a file and print all the matched lines as pipe delimited format.
My command is
cat m_gid_trans.XML|grep -i '<TABLEATTRIBUTE NAME ="Lookup cache directory name"'
The output I am getting is
<TABLEATTRIBUTE NAME ="Lookup cache directory name"... (4 Replies)
Discussion started by: sampoorna
4 Replies
4. Shell Programming and Scripting
Hi All,
Facing an issue with grep & sed
I have logs as below:
gsc_1_20121121.log:2012-11-21 10:09:13,143 INFO - fmsspace.1 ProcessNewOrderSingleRequest: Result - ProcessNewOrderSingleBatchResultDTO - success:true,newOrderSingleBatchResults:ProcessNewOrderSingleResultDTO -... (13 Replies)
Discussion started by: irfanmemon
13 Replies
5. Shell Programming and Scripting
Hi Friends,
I am using a command that prints certain lines from a file.
For ex:
cat input
abc chr1 456
def chr1 789
ghi chr1 999
jjj chr1 777
jhk chr7 914
My command
awk '{if($2=="chr1" && $3>=456 && $3<=999) {print $0}}' OFS="\t" input
Output being printed is
abc chr1 456 (7 Replies)
Discussion started by: jacobs.smith
7 Replies
6. Shell Programming and Scripting
I have several files with say something like
cat
sparrow
I can grep for "cat" and "sparrow" and usually the output is one below the other
cat
sparrow
How can I view these as columns say
Pets Birds
cat sparrow
Would be great if this can be on command line using awk or... (1 Reply)
Discussion started by: gubbu
1 Replies
7. UNIX for Dummies Questions & Answers
Hi
I am having a 'grep' headache
Here is the contents of my file:
(PBZ,CP,(((ME,PBZ,BtM),ON),((ME,((PBZ,DG),(CW9,PG11))),CW9,TS2,RT1)))
I would like to count out how many times 'PBZ' occurs and then place that number in the line above
3... (8 Replies)
Discussion started by: cavanac2
8 Replies
8. UNIX for Dummies Questions & Answers
Alright, here's the deal. I'm running the following ruby script (output follows):
>> /Users/name/bin/acweather.rb -z 54321 -o /Users/name/bin -c
Clouds AND Sun 57/33 - Mostly sunny and cool
I want to just grab the "57/33" portion, but that's it. I don't want any other portion of the line. I... (5 Replies)
Discussion started by: compulsiveguile
5 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I would like to know if this is possible, and if so what can i do to make this work.
I would like to grep a line X from fileA and then use the output to replace a word Y in fileB.
grep "line X" fileA | sed -e 's/Y/X/g' > outfile
this statement does not work, as i do not know how to... (7 Replies)
Discussion started by: cavanac2
7 Replies
10. Shell Programming and Scripting
This script is supposed to find out if tomcat is running or not.
#!/bin/sh
if netstat -a | grep `grep ${1}: /tomcat/bases | awk -F: '{print $3}'` > /dev/null
then
echo Tomcat for $1 running
else
echo Tomcat for $1 NOT running
fi
the /tomcat/bases is a file that... (2 Replies)
Discussion started by: ziggy25
2 Replies