开发者

Bourne: How to preserve a string in a variable?

I'm trying to execute the following line in Bourne:

LIST="-foo, -bar, baz"

However, I am getting an error:

-bar: c开发者_JAVA技巧ommand not found

Can anyone help me figure this out? Thanks!


This happens if the string is in fact not quoted.

Any chance you are doing LIST=$somevariable instead of what you wrote in the question? Because then you should write LIST="$somevariable" instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜