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

typeset -LZ




3 /aWorking/Zsh/Source/Wk 0 $ unset aaa; typeset aaa='  001200  '; dp aaa; echo $aaa
scalar aaa='  001200  '
  001200

3 /aWorking/Zsh/Source/Wk 0 $ unset aaa; typeset -L aaa='  001200 '; dp aaa; echo $aaa
scalar-left aaa='  001200  '
001200

3 /aWorking/Zsh/Source/Wk 0 $ unset aaa; typeset -LZ aaa='001200 '; dp aaa; echo $aaa
scalar-left-right_zeros aaa='001200  '
1200

3 /aWorking/Zsh/Source/Wk 0 $ unset aaa; typeset -LZ aaa=' 001200  '; dp aaa; echo $aaa
scalar-left-right_zeros aaa='  001200  '
  001200

... Is the last output really what we want?  '-LZ' ends up having no effect if there are leading spaces.  Wouldn't it be more useful if the leading spaces were always removed, as '-L' promises to do, and the '-Z' then insured that leading zeros were stripped as well?  That is, shouldn't the last two commands above both output '1200'?  As it is, the '-Z' and the '-L' basically cancel each other.






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