10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
i have a file which contains some messages counters.
below is the snippet on the file.
17-05-30::22:37:11|message|207... (5 Replies)
Discussion started by: scriptor
2. Shell Programming and Scripting
I am trying to grep one variable over the other variable
grep $j $i
I am getting this error:
The error is due to $i being variable and not file. I know I could do it by putting the value of abc in a file
and then greping it. (1 Reply)
Discussion started by: pinnacle
3. Shell Programming and Scripting
I've got a file that I'm trying to grep through that looks like this:
and I want the output to only contain the line with the highest value for each, so the output I want is:
I also need... (11 Replies)
Discussion started by: tiberione
4. Shell Programming and Scripting
I usually search extensively and have to date found what I've needed. However, this one's got me stumped. I need to create a variable as follow. The issue however is that upon execution, it freezes. $var1 isn't always present in usage.log and this is fine but I'd like it to continue with... (6 Replies)
Discussion started by: shadyuk
5. Shell Programming and Scripting
I have a pattern like:
column "5" is missing
PS: the no is in double quotes.
The number usally changes, so we use a loop to grep.
grep 'column "$number" is missing' filename.txt
But it is not working....
How to solve this? (2 Replies)
Discussion started by: karumudi7
6. Shell Programming and Scripting
I want to search a text in file but that file is pointing to variable.
file=there was nothing special
grep "there was nothing" $file
but its not working . Can u let me know that how we can use variable($file) in grep command.
Please use code tags (6 Replies)
Discussion started by: allthanksquery
7. Shell Programming and Scripting
can i grep a variable
say i have a variable var=`hostname` and I want to make an if statement like
if grep "esp-ueh" $var;then......
how can i do this
I dont want to store this variable in a file and the grep it because my script will be used at the same time on multiple stations and then that... (9 Replies)
Discussion started by: lassimanji
8. Shell Programming and Scripting
I am trying to do a simple thing in my mind. However I am fairly new to bash. What I need to do is create a folder for each partition on each CD, and each partition has a unique name (with spaces in it, do not ask why, it is already done :confused: ) . All CD's will show up... (2 Replies)
Discussion started by: sgstuart
9. Shell Programming and Scripting
Hi, I can't get this script to work (returns 0, should return 3):
$ cat A.lst | \
while read LINE
grep -c "$LINE" B.tmp
done> > > > >
but in contrast this one works fine (returns 3 as expected):
$ grep -c $LINE B.tmp
$ (5 Replies)
Discussion started by: ozvena
10. Shell Programming and Scripting
I'd like to grep a variable that I saved in the program.
grep '0\$variable1' file1
Does someone know what's wrong with this command?
Thanks a lot! (2 Replies)
Discussion started by: whatisthis