📄 dstack.tests
字号:
export LC_ALL=Cexport LANG=Cdirs -c# error -- nonexistant directorypushd /tmp/xxx-notthere# errors -- empty stackpushdpopd# errors -- bad numeric arguments -- should not cause the script to exitpushd -mpopd -mdirs -mdirs 7MYDIR=$PWDunalias cd 2>/dev/nullunalias -acommand cd -P /command pwd -P # better be `/'case "$OLDPWD" in$MYDIR) echo ok ;;*) echo oops -- bad \$OLDPWD ;;esacpushd /usrecho $PWD $OLDPWDdirsecho ${DIRSTACK[@]}# this should not change the directory stack at allpushd -n +0dirspopdpushd /usrpushd /etcdirsdirs -ldirs -v# two consecutive `pushd's should swap the top two stack elements, then# swap them back, leaving the stack intactpushdpushdpushd /tmpecho ${DIRSTACK[0]} ; dirs +0echo ${DIRSTACK[2]} ; dirs +2# these should be errors, but not affect the directory stackdirs +9; dirs -9pushd +9 ; pushd -9popd +9 ; popd -9popd -n +2dirsecho ${DIRSTACK[@]}pushd -n /usrecho $PWDdirsecho ${DIRSTACK[@]}builtin pwdDIRSTACK[1]=/bindirsbuiltin pwdpopd +2builtin pwd -Lpushd -1dirsecho ${DIRSTACK[0]}dirs -cdirs# this is for the benefit of pure coveragecd "$MYDIR"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -