开发者

Unix: assign variable to command

I am trying to assign the path of a file to a variable so I am doing something like:

PATH = dirname script.sh

However I am g开发者_如何学Pythonetting an error. Can someone assist? Thanks.

Sincerely,

Eric Anderson


There can be no spaces between the variable name and the equals sign. Also, I think you meant to run the dirname command, so what you would want is something more like this:

PATH=$(dirname script.sh)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜