Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bash to Zsh Funny
- X-seq: zsh-users 8574
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Bash to Zsh Funny
- Date: Thu, 10 Mar 2005 13:46:47 +0000
- In-reply-to: Message from zzapper <david@xxxxxxxxxx> of "Thu, 10 Mar 2005 13:24:15 GMT." <7gi0311elotb15km654vlvcfbhe5vqej7o@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <m5nt21910820l24esnv1ba14cnlb2f5go9@xxxxxxx> <fb6be96e0503090341b9bce6f@xxxxxxxxxxxxxx> <422EE58B.11159.2A9B3CE@localhost> <7gi0311elotb15km654vlvcfbhe5vqej7o@xxxxxxx>
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