Monday, December 16, 2013

wildcards in a script

www.unixbabuforum.inMy output of X depends on the input. If the input begins with an asterisk (*) an uppercase "X" should be used, if no preceding * then lower case. 

-x aix -x Linux -X *dmx -X *ndx -x tss -x tmp

www.unixbabuforum.incase $input in 
\**) echo X;; 
*) echo x;; 
esac 
www.unixbabuforum.inif [ `echo $variable | grep -c ^* ` -gt 0 ] 
then 
echo X 
else 
echo x 
fi 

0 comments:

Post a Comment

 
Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM