0
下面的shell腳本在遇到空間時引入換行符。Bash:Printf用換行符替換空格
countries = "Brazil Russia India"
printf "Countries are %s" $countries
輸出當屬:
Countries are Brazil
Countries are Russia
Countries are India
相反,它應是
Countries are Brazil Russia India
有什麼辦法來克服這種行爲?
如何在變量聲明中使用'='周圍的空格?你也可以使用'echo'國家是$國家'' – Sundeep