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.
awk
Name: Br1an Date: October 24, 2002 at 07:25:40 Pacific OS: Linux CPU/Ram: 256
Comment:
Hi, I want to print out ALL the words that appears more than N times from a file call "foo.txt", this is what i got: foo.txt: a b c e g o z a g a a a (assume that foo.txt only has 1 coloumn) now this is the command i got to do the job: (note that i asume that N=2 in this case) cat foo.txt | grep -v grep | grep -v awk| awk '{print $NF}' | sort | uniq -c | awk '$1 > 2'
however, if i put this in a script and i want to replace "2" by $variable, awk does not understand it cos $variable does not get imported ti AWK program... !!!! I heard that there is a way to pass a variable as an argument to AWK, right ? If so, i certainly can pass $variable to awk in this case. IF anyone knows about this, please let me know ASAP Thanks Brian
Summary: I have two files...file1 looks kinda like this: tomj male painter cynthiaw female administrator ... The other (file2) looks similar to this: mikek,painter tomj,manager ... The idea being that the file...
Summary: Hi there! When i exec. "uptime" i get to see the uptime of my machine on one line. How do get that information cropped so that i just displays the numbers of days it's been up en the total amount of h...