답변:
shopt
명령을 사용하여 Bash 내에서이 기능을 활성화 및 비활성화 할 수 있습니다 . 배쉬 맨 페이지에서.
발췌
cmdhist If set, bash attempts to save all lines of a multiple-line
command in the same history entry. This allows easy re-editing
of multiline commands.
lithist If set, and the cmdhist option is enabled, multi-line commands
are saved to the history with embedded newlines rather than using
semicolon separators where possible.
기능을 활성화합니다
$ shopt -s cmdhist
$ shopt -s lithist
기능을 비활성화합니다
$ shopt -u cmdhist
$ shopt -u lithist
$ shopt -s cmdhist
$ shopt -s lithist
이제 내가 실행할 때 history
:
70 text=$(cat<<'EOF'
hello world\
foo\bar
EOF)
71 text=$(cat<<'EOF'
hello world\
foo\bar
EOF
)
72 ls
73 cd IT/
...
...
414 shopt -s lithist
415 history | less
416 function blah {
echo blah
}
417 history | less