10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Im trying to search for a single variable in the first field and from that output use awk to extract out the lines that contain a value less than a value stored in another variable. Both the variables are associated with each other.
Any guidance is appreciated.
File that contains the... (6 Replies)
Discussion started by: ncwxpanther
2. Shell Programming and Scripting
I have a lot of files with keywords and unique names. I'm using a shell script to refer to a simple pattern file with comma separated values in order to match on certain keywords. The problem is that I don't understand how to handle the wildcard values when I want to skip over the unique names.
... (5 Replies)
Discussion started by: abercrom
3. Shell Programming and Scripting
When i am logged into a server , i am able to assign grep value to a variable as follows.
VAR=`grep 'Listener stopped' /logs/perf.log`
However, when i log out of the server, and try to execute the following command by first SSHing into server, it throws error.
$ VAR=`ssh Server... (4 Replies)
Discussion started by: srkmish
4. Shell Programming and Scripting
I have a script which reads a number out of a log file. The pertinent line is this:
When I run cat /tmp/listofnumbers what I am seeing is on each line.
I am trying to make the script read from that file and grep for a variable like the following line should do:
... (4 Replies)
Discussion started by: newbie2010
5. Shell Programming and Scripting
I have a list of fields that I want to check a file for, returning that field if it not found at all in the file. Is there a way to do a grep -lc and return the passed variable too rather then just the count?
I am doing some crappy work-around now but I was not sure how to regrep this for :0 so... (3 Replies)
Discussion started by: personalt
6. Shell Programming and Scripting
I would like for the user to input the date for a particular log file, then have the input sent to a variable, which is then used via grep to extra the logs for the specific date the user request.
I did some searching, but I still don't understand why I'm not seeing any result.
... (4 Replies)
Discussion started by: ravzter
7. Shell Programming and Scripting
I have a log file and I want to parse the logfile with a script.A sample text is shown below:
I would grep on "return code " on this file. Any idea how the lines above and below the grep patterns could also be extracted.
The runLoggingInstall return code is 0... (3 Replies)
Discussion started by: nua7
8. Shell Programming and Scripting
I found another problem with my disk-adding script today. When looking for disks, I use grep.
When I grep for the following disk sizes:
I also pick up these as well:
How do I specifically pick out one or the other, using grep, without resorting to the -v option?
... (9 Replies)
Discussion started by: LinuxRacr
9. Shell Programming and Scripting
Using shell scripts, I use grep to find the word “error” in a log file:
grep error this.log.
How can I print or get the line 3 lines below the line that word “error” is located?
Thanks in advance for your response. (9 Replies)
Discussion started by: cbeauty
10. UNIX for Dummies Questions & Answers
Is there a way to grep for something and then print out 10 lines after it.
for example if I want to grep for a word, then output the following 10 or whatever number of lines after the word. (5 Replies)
Discussion started by: eloquent99