Mar 30, 2006 #1 ogniemi Technical User Joined Nov 7, 2003 Messages 1,041 Location PL in a loop for i in ..... how test/check id $i has any capital letter?
Mar 30, 2006 #2 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR case $i in *[A-Z]*) echo $i has capital letter;; esac Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
case $i in *[A-Z]*) echo $i has capital letter;; esac Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Mar 30, 2006 #3 p5wizard IS-IT--Management Joined Apr 18, 2005 Messages 3,165 Location BE echo $i|grep -q '[A-Z]' if [ $? -eq 0 ] then echo $i has one or more capitals fi HTH, p5wizard Upvote 0 Downvote
Mar 30, 2006 #4 columb IS-IT--Management Joined Feb 5, 2004 Messages 1,231 Location EU Code: for i in one tWo three do typeset -l TEST TEST=$i [[ $i = $TEST ]] || echo $i has caps done Columb Healy Upvote 0 Downvote
Code: for i in one tWo three do typeset -l TEST TEST=$i [[ $i = $TEST ]] || echo $i has caps done Columb Healy
Mar 31, 2006 #5 columb IS-IT--Management Joined Feb 5, 2004 Messages 1,231 Location EU Here's another one for the collection Code: for i in * do expr index $i ABCDEFGHIJKLMNOPQRSTUVWXYZ >/dev/null && echo $i has caps done I'd like to have got rid of tha ugly ABCDEFGHIJKLMNOPQRSTUVWXYZ string but I'm not that good with expr. Columb Healy Upvote 0 Downvote
Here's another one for the collection Code: for i in * do expr index $i ABCDEFGHIJKLMNOPQRSTUVWXYZ >/dev/null && echo $i has caps done I'd like to have got rid of tha ugly ABCDEFGHIJKLMNOPQRSTUVWXYZ string but I'm not that good with expr. Columb Healy