Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Reading previous line
Name: Sayeed Date: August 6, 2003 at 16:00:10 Pacific OS: UnixWare
Comment:
Hello,
Currently am positioning at the 100th line with the AWK. How can I read & print its previous line#99th. Your reply is greatly appreciated. Thanks!!
Name: James Boothe Date: August 7, 2003 at 12:18:47 Pacific
Reply:
In the code below, for each line the if-statement selects (as coded it will be only the 100th line) it will print the previous line and the triggering line:
Summary: i am trying to read user input from read board and trying to save it in a file. I am using read, but it only allow to read one line. How can i read multiple lines from user input? thanks! ...
Summary: How I can search file and if word match, script will print that line and, for example, five previous line. (awk or other) 1 2 3 4 5 6 7 8 9 Match then will print line 4-9 ...
Summary: hi i'm having trouble in reading two consecutive lines.suppose if i have ten lines in a log file like Apr 16 16:32:50 abhargav sshd[1373]: Failed password for abhargav from 127.0.0.1 port 32930 ssh2...