Hi,
I have multiple files where it starts with test1.c, test2.c,test3.c and so on.
I would like to get each file separately to perform abstraction from these files.
I tried something like:-
for t in ./*
filenumber=${t:4} # to cut the "test" in order to get the number
cat... (3 Replies)
I am given a file with a list of names for the first 20 characters. The 20 characters after is a list of names that somebody is supposed to team up with.
Now i'm trying to write a simple script that will read a name somebody inputs and then looks only in the first 20 characters.
For example.... (2 Replies)
File1.txt
.......
.......
OMC LA
OMC LK
OMC LS
........
........
Above is the content of File1.txt, i want to get the Number of Occurence to order, lets say if OMC LA = 1, OMC LS=3, and OMC LK=2..
omc_ident="OMC LA" or "OMC LK" or "OMC LS"
omc_num=`grep '^OMC' File1.txt| grep... (4 Replies)
Hi,
I want to search for a return code of -3. Using grep "-3" *.* is giving a syntax error. Please suggest as to how can we search for this pattern using grep.
Thanks,
Krishna (2 Replies)
I have a data file that is arranged like this:
Marketing Ranjit Singh Eagles Dean Johnson FULL
Marketing Ken Whillans Eagles Karen Thompson FULL
Sales Peter RobertsonGolden TigersRich Gardener PART
President Sandeep Jain Wimps Ken Whillans CONT... (7 Replies)
Dear All,
I plan to write a script and in the beginning, I will check if there's any existing previous process running, if YEs, then exit directly, if Not, then continue.
#!/bin/bash
NUM=`ps -ef | grep $0 | grep -v grep | wc -l`
ps -ef | grep $0 | grep -v grep
echo "NUM ==> $NUM"
if... (6 Replies)
which one of the following is the correct expression to ignore line with multiple spaces after any string
cat file | grep -v "xyz *$"
or
cat file | grep -v "xyz*$"
do i need "*" to specify the sapce or " *" will do? (2 Replies)
ps -ef |grep /usr/sbin/qdaemon
root 5034194 385266 0 Oct 26 - 1:57 /usr/sbin/qdaemon
root 7639132 2523220 0 15:25:58 pts/10 0:00 grep /usr/sbin/qdaemon
ps -ef |grep /usr/sbin/qdaemon |wc
2 18 145
I need to send out e-mail if the count of the lines... (9 Replies)
Hi,
I have variable called fname that has the value M201401151630_P008949.csv.txt
I need to grep and store this in a variable called prcid for the number before ".csv" and the letter "P" excluding all zeros in the beginning.
Desired output 8949
Likewise for M201401151630_P108949.csv.txt... (12 Replies)
Hello,
I am newbie to bash scripting. Could someone help me with the following.
I have log file with output as shown below
**************************LOG*************************
11/20/2013 9:11:23.64 Pinging xx.xx.xx.xx with 32 bytes of data:
11/20/2013 9:11:23.64 Reply from xx.xx.xx.xx:... (4 Replies)
Discussion started by: meena_2013
4 Replies
LEARN ABOUT NETBSD
zgrep
ZGREP(1) BSD General Commands Manual ZGREP(1)NAME
zgrep, zegrep, zfgrep -- print lines matching a pattern in gzip-compressed files
SYNOPSIS
zgrep [grep-flags] [--] pattern [files ...]
zegrep [grep-flags] [--] pattern [file ...]
zfgrep [grep-flags] [--] pattern [file ...]
DESCRIPTION
zgrep runs grep(1) on files or stdin, if no files argument is given, after decompressing them with zcat(1).
The grep-flags and pattern arguments are passed on to grep(1). If an -e flag is found in the grep-flags, zgrep will not look for a pattern
argument.
zegrep calls egrep(1), while zfgrep calls fgrep(1).
EXIT STATUS
In case of missing arguments or missing pattern, 1 will be returned, otherwise 0.
SEE ALSO egrep(1), fgrep(1), grep(1), gzip(1), zcat(1)AUTHORS
Thomas Klausner <wiz@NetBSD.org>
BSD December 28, 2003 BSD