3.5.2 波浪号展开(Tilde Expansion)

2017-10-17  本文已影响0人  Doerthous

一般形式


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

注意点


待完善

“~”展开为变量$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’

上一篇 下一篇

猜你喜欢

热点阅读