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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

descriminating between capital and lowercase

Status
Not open for further replies.

noiz

IS-IT--Management
Apr 19, 2001
17
US
Hi all,

i was working on a bourne shell script that would
take input and then direct you to a different place depending on whether you typed a upper or lower case letter. i cann't seem to get it to work and thought i might use awk but cann't get that to work in the script either. I know awk can descriminate between cases. but how do i get it to execute a command upon success or failure?

Thank you for your time

zion

<><
=-)


 
#!/bin/sh

echo -n &quot;Input your character.&quot;

read ans


case $ans in

[A-Z]) echo &quot;caps&quot; ;;

[a-z]) echo &quot;nocaps&quot; ;;

esac

wrap it in a while loop.

Luck.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top