03-15-2004
how about "awk '{ print $blah blah blah }'|head -2000"
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In a loop, I want to append some text to a file without generating a new line (and then force a new line before re-iterating the loop). In the code below the first 'echo' command is OK as it uses '--n' for no new line. For the 'awk' line I *thought* I could solve it by using printf rather than... (1 Reply)
Discussion started by: TobyR
1 Replies
2. Shell Programming and Scripting
Hi there all,
I am using a line to get some replys from my PS
I do
ps -ef |awk '{printf $9}'
But my result is 1 big line.
No spaces between the lines or someting
for example:... (2 Replies)
Discussion started by: draco
2 Replies
3. UNIX for Dummies Questions & Answers
I want to display "no results found" if a grep search of a name that the user inputs is not found anywhere in a certain file,
Right now I have this, but doesn't seem to work. Im not sure what to change.
read name
results=grep -c $name file
if ;
then echo "No results found."
exit... (1 Reply)
Discussion started by: busdude
1 Replies
4. Shell Programming and Scripting
Hi all u brilient people on the forum...
I am trying to call the variable value in awk command for search pattern /start/,/stop/ but i am nt able to do this ....
wat i did is ..i have created two variable YESTERDAY and TODAY and passed the y'day n 2'days dates in it...like this
... (14 Replies)
Discussion started by: whomi
14 Replies
5. Shell Programming and Scripting
I have 2 files as follows:
filename1: :
6742 /welcome/mundial98_ahf1_404.htm 1020
6743 /welcome/mundial98_ahf1_404.htm 2224
6744 /welcome/mundial_ef1_404.htm 21678
6745 /welcome/mundial_if_404.htm 4236
6746 /welcome/mundial_lf1_404.htm 21678
filename2:
6746 894694763 1... (2 Replies)
Discussion started by: jontjioe
2 Replies
6. Shell Programming and Scripting
In unix i have to start service and it promts to enter port number:
/usr/mydir/ca >./stop_ca_devp
And it prompts message like :
Enter the port number of the server you would like to shut down :
Then I type xxxx then it stops the service.Now what I need is remove manual intervention.... (3 Replies)
Discussion started by: krsnadasa
3 Replies
7. Shell Programming and Scripting
Hi guys,
I'm struggling with this one, any help is appreciated.
I have File1 with hundreds of unique words, like this:
word1
word2
word3
I want to count each word from file1 in file2 and return how many times each word is found.
I tried something like this:
for i in $(cat file1); do... (13 Replies)
Discussion started by: demmel
13 Replies
8. Shell Programming and Scripting
Hello,
I have massive number of big files that needed to be counted for the total number of lines (> 100x millions) each. I want the file name attached to the count results so that they are aligned nicely matching name and counts.
I could do each file at a time, which will take hours to finish,... (8 Replies)
Discussion started by: yifangt
8 Replies
9. UNIX for Beginners Questions & Answers
Hi
I wanted to know if there is an option in grep command to show the number of results (not the number of lines of findings).
Thanks (14 Replies)
Discussion started by: abdossamad2003
14 Replies
ZGREP(1) General Commands Manual ZGREP(1)
NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
ZGREP(1)