10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Suppose I have a command:$ cmd1 | cmd2I need to send a message from cmd2 to cmd1 when I receive some a certain message from cmd1. How to do this?
I think that I have to know cmd1's PID and then in cmd2 send a message to this PID. How? (24 Replies)
Discussion started by: JackK
24 Replies
2. UNIX for Advanced & Expert Users
Hi scripters,
I'm quite used to run commands in the background using & like in:
$ myscript &But this is NOT what I'm trying to do today. What I'm trying to achieve is to run a script the normal way (without &), have my script do a little checkup and then jump to background. Something like:... (5 Replies)
Discussion started by: chebarbudo
5 Replies
3. Shell Programming and Scripting
Hey,
I am trying to compare formated login and logout dates from one user at a host which I have stored in a tmp directory in order to find out the total login time. I need to compare them in order to find overlapping intervals.
At first I tried to store each log in and logo date in an array... (3 Replies)
Discussion started by: Mumu123
3 Replies
4. Shell Programming and Scripting
I need to read the contents of a file. Then I need to grep for a keyword and replace part of the grepped line based on the condition of previous and present line.
Example input file:
V {
port1 = P;
port2 = 0;
shift_port = P0; /* if next shift_port is P0 I need... (9 Replies)
Discussion started by: naveen@
9 Replies
5. Shell Programming and Scripting
Hi,
I am currently trying to work out how to compare one line with the last line I have read in via ksh. I have a file which has sorted output from a previous sort command so all the lines are in order already and the file would look something like show below. Each line has a name and a time... (5 Replies)
Discussion started by: paulie
5 Replies
6. Shell Programming and Scripting
Hi,
I have one small doubt how to go ahead and process the below requirement.
File Content
1,abc,10
2,xyz,11
3,pqr,12
4,pqr,13
5,pqr,14
Output file expected:
1,mnq,1
1,ddd,2
1,qqq,3
1,sss,4
1,ddd,5
1,eee,6
1,fff,7
1,ddr,8
1,rrd,9 (3 Replies)
Discussion started by: dikesm
3 Replies
7. UNIX for Dummies Questions & Answers
Hi guys,
I have found your forum super useful. However, right now I am stuck on a seemingly "simple" thing in AWK. I have two columns of data, the first column in Age (in million years) and the second column is Convergence Rate (in mm/yr).
I am trying to process my data so I can use it to... (2 Replies)
Discussion started by: awk_noob_456
2 Replies
8. Shell Programming and Scripting
Hello,
Can anybody help me to correct my sed syntax to find the string and print previous two lines and current line and next one line.
i am using string as "testing"
netstat -v | sed -n -e '/test/{x;2!p;g;$!N;p;D;}' -e h
i am able to get the previous line current line next line but... (1 Reply)
Discussion started by: nmadhuhb
1 Replies
9. Shell Programming and Scripting
hi,
i am new to this site.
i want to write a script to compare the file size of the files in the current dir with the files in the previous directory.
the files name will be same, but the filename format will be as xyzddddyymm.txt. the files will arrive with the month end date(i want to... (5 Replies)
Discussion started by: tweety
5 Replies
10. Shell Programming and Scripting
Hi,
how can i print the previous, current and next line using sed?
current line is the matching line.
The following prints all lines containing 'Failure' and also the immediate next line
cat $file | sed -n -e '/Failure/{N;p;}'
Now, i also want to print the previous line too.
Thanks,... (8 Replies)
Discussion started by: ysrinu
8 Replies