As a stylistic issue, I would dissuade from the use of grep -c and [ xxx -eq 0 ] -- especially on $? -- in favor of something like
Also note the redirection of the error message to file descriptor 2. You might want to add $0 to the beginning of the error message as well.
The use of {1} in the regular expression is obviously redundant. In order to reduce backtracking, you might want to use [01][0-9]{0,2} to cover all strings beginning with 0 or 1 in one go, aand adjust the subsequent expression accordingly.
This is what I have to check date entries in an interactive script with the end users... I use this to build control cards for a reporting utility supplied by a software vendor.
I also want to check to make sure its a valid day based on the month (ie 30days has sept, april, june and Nov..)... ... (2 Replies)
how do i validate y script so that it only accepts values between 1 and 3 and against any character input, cause at the moment i can only validate against numbers outside 1 and 3 but not characters
cheers (4 Replies)
What's wrong with this syntax? It's part of my 'if' statement but it doesn't seem to pass and it keeps going to the 'else' part.
I thought it says that userid must start with a non-numeric character and is between 6 and 10 characters long (alphanumeric).
$userid|grep -Eq '^?\{6,10\}+$'
if... (2 Replies)
Hi there,
I'm trying to validate my $1 and $2 before I use them in the sqlplus update, I think I have the validation rules set correctly??? however when I test my script, it jumps straight into the sql. It doesn't seem to validate the vars....even when I know they are incorrect.
if ; then
... (6 Replies)
HELP: validating IP addresses any way possible
--------------------------------------------------------------------------------
I am trying to validate input from the user in a script. I thought is was easy to do using regular expressions but I can't figure out how to use REs in a... (1 Reply)
:) Firstly Hi all!!, im NEW!! and on here hoping that someone might be able to offer me some help... i have a server that keeps crashing every few days with the error message:
PANIC KERNAL-MODE ADDRESS FAULT ON USER ADDRESS 0X14
KERNAL PAGE FAULT FROM (CS:EIP)=(100:EF71B5BD)
EAX=EF822000... (10 Replies)
Pardon my ignorance but I am lost on how to do this
I have a file called "Sample.txt", it is pipe delimited, it should have 13 fields. But some of the records do not, I would like to set up a shell script
where I can pass in a parameter "Sample.txt" and it would split the file into records... (2 Replies)
HI,
I am trying to write a validation script as below
awk '($1=="ABC"&&$2="XYZ" ,then check the value in $8,$10 these columns should not be null.
so their should be some corresponding value n the $8 and $10 column,if their is no value the script has to give error saying that at a... (2 Replies)
i need to verify whether the ip adress given as input to the shell script is pingable or not... that is whether the ip is alive and responding..
ping $ip_adress
the above wont work in script because the execution is continuous... so the shell script keeps will dwell in this pinging process...... (8 Replies)
Hi ,
Could someone let me know how to detect duplicate ip address after assigning ip address to ethernet interface using c program (3 Replies)
Discussion started by: Gopi Krishna P
3 Replies
LEARN ABOUT MINIX
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)