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

Re: typeset -Z broken? -R broken too?



It appears that -R is broken, too.

Here is output of ksh with -R
=== gabor $ typeset -R20 name;for name in *;do print "$name";done
                bin/
     sample-scripts/
           software/
               test/
=== gabor $ 

And here is zsh
=== gabor $ typeset -R20 name;for name in *;do print "$name";done
bin/
sample-scripts/
software/
test/
=== gabor $ 

Also, even with the fix here is zsh for -Z
=== gabor $ typeset -Z20 name;for name in *;do print "$name";done
bin/
sample-scripts/
software/
test/
=== gabor $ 

And here is ksh
=== gabor $ typeset -Z20 name;for name in *;do print "$name";done
                bin/
     sample-scripts/
           software/
               test/
=== gabor $ 

Here they are with 0 prefix for test dir
ksh
=== gabor $ typeset -Z20 name;for name in *;do print "$name";done
000000000000000test/
                bin/
     sample-scripts/
           software/
=== gabor $ 

zsh
=== gabor $ typeset -Z20 name;for name in *;do print "$name";done
000000000000000test/
bin/
sample-scripts/
software/
=== gabor $ 


:(

On Sun, Sep 05, 1999 at 08:57:22AM -0400, Gabor wrote:
# 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