Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想回显一个第一个字符是空格的字符串,例如line=" a"; echo $line;但是,结果显示没有第一个空格,例如只是"a"而不是" a".
line=" a"; echo $line;
"a"
" a"
只需在变量名称周围用双引号打印它:
$ line=" a" $ echo "$line" a