Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check for numeric result

Status
Not open for further replies.

dickiebird

Programmer
Feb 14, 2002
758
GB
Guys
Any way I can check / force a numeric result ?
Given :

typeset-i seconds
seconds=`lsuser -a time_last_login $user|cut -d"=" -f2|cut -c1-10`

I need to check $seconds > 0 , but if the result of lsuser is blanks/nulls/spaces, then the script returns :

0403-009 The specified number is not valid for this command.

Any thoughts?
TIA ;-)
Dickie Bird
Honi soit qui mal y pense
 
I got it meself !
I check the output of the lsuser is > 8 characters (means the attribute is set) and has a value - then do the cutting of those valid values as opposed to cutting nothing / null / space.
Doesn't answer my question - but at least it works now. Dickie Bird
Honi soit qui mal y pense
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top