2012-11-22 5 views
0

shopt xpg_echo이 활성화되거나 비활성화되면 변경되는 내용을 이해하지 못합니다. 수동에서배시 shopt xpg_echo

: I 활성화/xpg_echo를 비활성화하려고했으나 에코

xpg_echo 
     If set, the echo builtin expands backslash-escape 
     sequences by default. 

는 동일한 동작이 있습니다. 에코 \n 같이 이스케이프 시퀀스를 처리 할 경우

답변

2

이 결정이 동작의 절반

$ shopt -u xpg_echo # Disable xpg_echo 
$ echo "Hello\nworld" 
Hello\nworld 
$ shopt -s xpg_echo # Enable xpg_echo 
$ echo "Hello\nworld" 
Hello 
world 
+0

이고; 동시에'posix' 플래그를 설정하면 bash는'echo'에 대한 표준 문자를 따르게되므로'-e'가 실행될 때 출력에'-e'를 출력합니다. http://pubs.opengroup.org/onlinepubs/009604599/utilities/echo.html을 참조하십시오 (APPLICATION USAGE 섹션을 간과하지 않도록하십시오). –

관련 문제