zsh conditional statement help

Posted by Roy Rico on Super User See other posts from Super User or by Roy Rico
Published on 2011-02-13T23:15:16Z Indexed on 2011/02/13 23:27 UTC
Read the original article Hit count: 268

Filed under:
|

Feeling kinda dumb right now:

Why is my contional always true?

I've tried

# this should let me know what's not a directory or 
# symbolic link.
whoa=`find ${MUSICDIR} ! -type l ! -type d | wc -l`

# I would expect if it's 0 (meaning nothing was found) that
# one of these statements would evaluate to false, but so far
# it's always evaluating to true
if [[ "${whoa}" != "0" ]]
if [[ ${whoa} -gt 0 ]]

What am I missing?

© Super User or respective owner

Related posts about command-line

Related posts about zsh