View Single Post
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#767
Win7Mac,

If you want to check for a number in your output and give an empty output while giving a non-empty output when there is an alphabet with the number you could use test this way:

Code:
test -z "$NN" -o -n "`echo $NN | tr -d '[0-9]'`" && echo $NN
 

The Following User Says Thank You to thedead1440 For This Useful Post: