美文网首页
3.5.2 波浪号展开(Tilde Expansion)

3.5.2 波浪号展开(Tilde Expansion)

作者: Doerthous | 来源:发表于2017-10-17 02:06 被阅读0次

    一般形式


    “~username”或“~+”或“~-”或“~N”或“~+N”或“~-N”。其中username指linux中用户的用户名,N代表数字。

    注意点


    • 如果username无效或tilde展开失败,则word保持不变
    待完善

    “~”展开为变量$HOME
    “~/foo”展开为$HOME/foo
    “~fred/foo”展开为用户fred家目录下的子目录foo
    “~+”展开为变量$PWD的值
    -”展开为${OLDPWD-’-’}
    “~N”展开为The string that would be displayed by ‘dirs +N’
    “~+N”展开为The string that would be displayed by ‘dirs +N’
    “~-N”展开为The string that would be displayed by ‘dirs -N’

    相关文章

      网友评论

          本文标题:3.5.2 波浪号展开(Tilde Expansion)

          本文链接:https://www.haomeiwen.com/subject/todruxtx.html