The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



Thread: Not working
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-11-2007
jim mcnamara jim mcnamara is offline
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,373
Code:
#!/bin/ksh                                                                       
                                                                                 
okay=$(head -1 $1 | awk '{print substr($0, length($0)-2)}' | \
       awk '{print index("001|004|007",$0)}')                                                              
if  [[ $okay -gt 0 ]]  then
      print "okay"
else
      print "not okay"
fi
Reply With Quote