08-24-2019
Your given grep command on your given input file DOES produce the expected output.
Are you using a special grep program? Try /bin/grep
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello I need to run an sql script and then the output result to be in non-delimitted file
What is the execution command to obtain this.
For eg: the following outputs the result to a space delimitted file
db2batch -d ${EC_DB2_DBNAME} -f ${TMP_SCRIPT_NAME} -a ${CURR_DB_ID}/${CURR_DB_PWD} -r... (1 Reply)
Discussion started by: cosec
1 Replies
2. Programming
I have five classes. 2 composition classes,1 aggregation class and 1 dependency class.I have coded all the classes but one of my test program is not giving me the expected result.I have the following classes:
TimeStamp
Interval (composition of 2 TimeStamps)
TimeSheet ( aggregation of many... (3 Replies)
Discussion started by: moraks007
3 Replies
3. Shell Programming and Scripting
Good morning everybody,
Beeing an absolute newbie in shell scripting I would like to look for some help here.
I would like to read an external text file and format the data and write it to an output file.
What I was trying to do was to display the result (this worked).
But now I... (1 Reply)
Discussion started by: bluejean1976
1 Replies
4. Shell Programming and Scripting
Hi,
I don't script often enough to know how to do this, and I can't seem to find a right example online. I have a csv output from an old, old system (Win2K???), from which I want to extract only certain fields. Initially I came up with something like this:
cat file1 | awk -F '"' '{print $8... (7 Replies)
Discussion started by: takada
7 Replies
5. Shell Programming and Scripting
Main_script.sh
#! /bin/sh
./Sub_script.sh
rc=$?
echo "Return code from Sub_script.sh : $rc"
if ; then
echo "$rc = 991"
echo ""
exit 1
elif ; then
echo "$rc = 992"
echo ""
exit 1
elif ; then
echo "$rc = 0"
echo ""
exit 1
fi (2 Replies)
Discussion started by: duddukuri
2 Replies
6. Shell Programming and Scripting
Can Anyone help with looping...
awk 'FNR==1{i++}
{for(k=1; k<=NF; k++) A=$k} # 3 Dimension Array
END{
for(i=1;i<=217;i++) # For loop 2nd File 1st and 2nd column
x=0;y=0 ... (18 Replies)
Discussion started by: Akshay Hegde
18 Replies
7. Shell Programming and Scripting
Hi I would appreciate your help with this.
I have a output file from a command. It is broken based on initial of the users. Exmaple of iitials MN & SS. Under each section there is information pertaining to the user however each section can have different number of lines. MY challenge is to ... (5 Replies)
Discussion started by: mnassiri
5 Replies
8. Shell Programming and Scripting
lyang001@lyang001-OptiPlex-9010:~$ service --status-all |grep dbus
acpid
acpi-support
alsa-restore
alsa-store
anacron
apport
atd
avahi-daemon
bluetooth
cgroup-lite
console-setup
cron
cups
dbus
dmesg
dns-clean
failsafe-x
... (1 Reply)
Discussion started by: yanglei_fage
1 Replies
9. Shell Programming and Scripting
Hello,
I am trying to print out the first string matching query with grep and I need your help.
My scenario:
Database
John F
4433 Street No 88 CA
Elisabeth Taylor
7733 Street No 26 ON
Jack Nicholson
0133 Green Park No 34 AR
John F 2
9399 Southpark No 02D UT
test.sh... (6 Replies)
Discussion started by: baris35
6 Replies
10. Shell Programming and Scripting
Hi Experts,
I have written the below script but its not working as per expectation.
My requirement is if this condition ] is satisfied
then only check for this condition ] if this also satisfied check for the condition ].
vi p_values.ksh
path="/db/ora/files"
mode=1
b_days=10... (5 Replies)
Discussion started by: nalu
5 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)