Guest BooYah Posted September 18, 2003 Report Share Posted September 18, 2003 Is there a way to use case in this sense? It doesn't seem like it can do tests. case i in $( ls -A ) [ -x "$i" ] ) echo "$i is executable" etc. Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted September 18, 2003 Report Share Posted September 18, 2003 If I understand well what you want, you would rather use "for". Example: for i in $( ls -A ); do [ -x "$i" ] && echo "$i is executable" # or: if [ -x "$i" ]; then echo "$i is executable" fi done Yves. Quote Link to comment Share on other sites More sharing options...
Guest BooYah Posted September 18, 2003 Report Share Posted September 18, 2003 Yeah, that's what I want, but I was wondering if I could just jump right into a case function rather than for and if loops. Guess not. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.