Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
typeset -LZ
- X-seq: zsh-users 28893
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: typeset -LZ
- Date: Thu, 2 Feb 2023 20:06:09 -0800
- Archived-at: <https://zsh.org/users/28893>
- List-id: <zsh-users.zsh.org>
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