Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bash to Zsh Funny



zzapper wrote:
> Any improvments?

>    if [ "$files" != "" ]

It would probably be more standard to rewrite this as

if [[ ${#files} -gt 0 ]]

or equivalently

if (( ${#files} ))

which test whether there are any elements in the array.  However, in
practice what you have will work fine, since a zero-length filename
is meaningless.

pws


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author