多字的文字。當我在寫一個shell腳本是這樣的:讀取命令行
echo -n 'Enter description of new version: ';
read desc;
git commit -m $desc;
,當我進入多字的說明,則僅取一個字爲$遞減 和給我的錯誤是:
Enter description of new version: hope it works
error: pathspec 'it' did not match any file(s) known to git.
error: pathspec 'works'' did not match any file(s) known to git.
fatal: too many params
,有時是給這樣的:
Enter description of new version: final check
error: pathspec 'check'' did not match any file(s) known to git.
fatal: Failed to resolve 'check'' as a valid ref.
Everything up-to-date
什麼是p與我的劇本一起嗎?
請建議的原因和解決方案來讀取命令行多字描述成變量$遞減
我已經嘗試使用:
echo -n 'Enter description of new version: ';
read text;
desc="'"$text"'";
git commit -m $desc;
但是沒有用。
預先感謝您
我試着用'git commit -m'$ desc''和'git commit -m'''$ desc'「''但它沒有用,爲什麼? – sivareddy963