Operating System - HP-UX
1758743 Members
2762 Online
108874 Solutions
New Discussion юеВ

Re: ksh script needing an interger cmd. line arg

 
SOLVED
Go to solution
Sridhar Bhaskarla
Honored Contributor

Re: ksh script needing an interger cmd. line arg

Marc,

Interesting. Did you have any instance where it couldn't get to work?. That will help me rectify my logic.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Marc Ahrendt
Super Advisor

Re: ksh script needing an interger cmd. line arg

sridhar, below succeeds and f is not an interger
echo "f + 5" | bc 2>&1
hola
Sridhar Bhaskarla
Honored Contributor

Re: ksh script needing an interger cmd. line arg

Didn't have a system infront of me now. But I know where it would be missing. Try this out.

....
echo "${3}.1 + 1 " |bc 2>&1 |grep syntax > /dev/null
............

if [ $? = 0 ]

....

Thanks for letting me know.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try