The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 05-25-2007
Abhishek Ghose Abhishek Ghose is offline
Registered User
  
 

Join Date: Sep 2005
Location: Chennai
Posts: 81
Oneliner

Here's an oneliner:

awk -v x=$a 'END{if(x==x+0) print "integer"}' /dev/null



In this example , a is shell variable.
If a=10, then the output of above is "integer"
If a="10abhishek", then the output of above is ""