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

typeset -Z broken?



Here is the relevant part of the man page


              -Z     Right justify and fill with leading zeros if
                     the first non-blank character is a digit and
                     the  -L  flag  has  not  been  set.  If n is
                     nonzero it defines the width of  the  field;
                     otherwise  it  is determined by the width of
                     the value of the first assignment.

yet, when I use this I get left padding with zeros even on names that don't
start with a digit

typeset -Z10 nname
for name in *; do
    if (( ${#name} < 10 )) then
	nname=$name
	mv $name $nname
    fi
done



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