Hello,
I normally program in Perl, today I'm in ksh. Having some trouble...
I want to assign my second parameter for my program based on whether it is a
number or not.
I tried:
FILENM=$1
if [[ -z "$2" || "$2" != /^\d+$/ ]] then
QUEUE=$2
WIDTH=$3
PGLINES=$4
else
WIDTH=$2
PGLINES=$3
fi
Hopefully you can see I thought I'd use a regexp to determine if its a number or
not. This didn't work. Probably because I'm guessing on the regexp format for
ksh. Any help, or perhaps a better way to solve my problem?
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Phil R Lawrence phone: 610-758-3051
194 Lehigh University Computing Center
E.W. Fairchild - Martindale, Bldg. 8B
Bethlehem, PA 18018
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~