If you really want to count, then consider the -c option for grep.
To concatenate outputs from different commands into one file there are 3 methods:
More efficient:
Even more efficient:
Can be written as mulit-line:
Last edited by MadeInGermany; 12-03-2019 at 05:22 AM..
This User Gave Thanks to MadeInGermany For This Post:
Hi all, I am taking my first course in unix and having some problems.
I would line to create a scrip that does the following:
1) will tell me the number of users logged in. If a user is logged more than once just count it only ones.
2) want to be able to display the number of users that... (1 Reply)
hi floks !
i'd like to know how can i transmete a character or a string from my source code to a term and make it interpret or un by the shell wich is running in my term.
I'd like to create a Term from my code (and get its file descriptor) and then transmete each char typed on the keyboard to... (1 Reply)
Hi All,
I have an input_file below and i would like to use Perl to search for the term "aaa" and output the 3rd term in the same row as "aaa".For Example, i want to search for the term "ddd" and would want the code to ouput the 3rd term in the same row which is "fff". Can somebody help ?
... (28 Replies)
hello everyone,
I'm trying to learn some scripts but i cant get my head around two of them.
1. how can i write a script that will count the number of times a particular word is used in file?
2. how can i make a script that will take me to a web page from unix?
if anyone could help it... (3 Replies)
guys,
I am new shelll scripting..
this a question on passt exam paper, I was trying to solve it , I can not.
the question is as follow?
a. Write a shell script to count the number of accounts which belong to particular primary group in a standard UNIX system which uses local... (1 Reply)
how to count the total number of lines of all the files under a directory using perl script..
I mean if I have 10 files under a directory then I want to count the total number of lines of all the 10 files contain. Please help me in writing a perl script on this. (5 Replies)
Hi Experts,
I want to know the count of specific word in a file. I have almost 600+ files.
So I want to loop thru each file and get the count of the specific word.
Please help me on achieving this...
Many thanks (2 Replies)
Hi
I have a file with number of entries
name 1 123
name 1 345
name 1 65346
name2 3243
name2 24234
name 2 234234
so on .........
how to count total number of entries for name 1 and name2...and so on Please guide. (1 Reply)
Hi All!
I would like to have a script that will count the number of files at the top of the hour of soome directories and mail the results to me.
I was thinking on :
a=`/directory/subdirectory/ | wc -l`
echo "/directory/subdirectory :$a"
b=`/another_dir/subdir/ | wc -l`
echo... (12 Replies)
Hi,
I need a solaris shell script to read multiple files and count number of unique name rows(strings) from those files. The input and output should be like this
Input:
file 1
abc
cde
abc ... (9 Replies)
Discussion started by: ssk250
9 Replies
LEARN ABOUT POSIX
zgrep
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)