Thank you, one more question. What value would the variable have upon a empty result? I put null in here for an example. I hope the question makes sense.
I know that this is a ridiculously simple statement, but I am getting an error when I execute it, and I can't figure out what it is. Can anyone point me in the right direction?
#!/bin/ksh
integer dateMonth=0
integer intZero=0
if
then
dateMonth = 1
fi
echo $dateMonth (7 Replies)
I'm having an issue running multiple commands in a case statement. If i only run one command it works fine. Am I supposed to use double semi-colons after each statement or do i not need any at all?
here is a snippet of the code:
case `uname` in
"Linux")
echo This is linux.
cat... (1 Reply)
Hello,
I am trying to create a simple script that will check the disk usage of a drive, and if it is over the limit it will delete the oldest ten files. everything is working except for when i implement the if statement i get the error
/usb0: zero divisor.
I am pretty sure that the du -k... (1 Reply)
Hi there,
Im new in the scripting world and ran into trouble yesterday. I want to make a small script that runs in crontab checking folders. If the folder size is greater than 10 (or what I set the variable to) then send a mail with a warning.
#!/bin/sh
set -x
A=8
C=`du -skh... (7 Replies)
guys,
in one of my script, I want to include and a if and then statement which basically does the the following:
if a file (constant location and filename) is greater in size than 0 bytes, then it should send out an email.
I have tried the following so far with no luck:
1) if # is... (1 Reply)
Hi guys,
I'm typing the following command, but I'm getting a different output than expected.
for file in *20*
do
ls -l $file | wc -l
done
Instead of listing a total count of the files, it seems to be counting each file and then printing the number of the file - which is 1. How... (7 Replies)
if ]; then
echo "successssssssssssssssssss"
$filename = "<font color='red'>$i</font>"
else
echo "failureeeeeeeeeeeeeeeeeeeee"
$filename = "$i"
fi;
I'm just trying to see is this - read a file name and highlight... (2 Replies)
So I'm writing a script that takes in arguments given from the shell. The last argument I'm using as a tag to tell my script, via if statements, to do one thing or another. A sample input would be:
script.scr infile.txt outfile.txt F
The "F" at the end there I expect to be one of two tags... (3 Replies)
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Hi all,
I thought this would be simple, but I've been having a lot of trouble trying to write this IF statement, if I may ask for help pls:
In BASH, how would I construct the if statement:
Should ONLY be true if USEROPTscript=="yes"]] AND $mode=="INSTALL" /or/ $mode=="CHANGE" ]]... (3 Replies)
Discussion started by: jmccoughlin
3 Replies
LEARN ABOUT V7
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)