0
看起來像尾隨'\n'
字符被修剪爲"$()",
,而我從bash manual找不到關於此的任何規範。這真的讓人困惑,任何人都可以幫我解釋一下嗎?
[[email protected]_6_207_centos ~]$ a="$(echo $'abc\n\n' | cat)"
[[email protected]_6_207_centos ~]$ echo "$a"
abc
[[email protected]_6_207_centos ~]$ a="$(echo $'abc\n\nb' | cat)"
[[email protected]_6_207_centos ~]$ echo "$a"
abc
b
[[email protected]_6_207_centos ~]$ a=$'abc\n'
[[email protected]_6_207_centos ~]$ echo "$a"
abc
[[email protected]_6_207_centos ~]$ a="$(echo $'abc ' | cat)"
[[email protected]_6_207_centos ~]$ echo "$a" | url_encode
abc%20%20%0A[[email protected]_6_207_centos ~]$