开发者

What does this line means in a shell script?

开发者 https://www.devze.com 2023-01-29 16:36 出处:网络
What does this line means in a shell script? THIS_SCRIPT=$(readlink -f $0)开发者_开发知识库 It assigns the path of the script to variable THIS_SCRIPT.

What does this line means in a shell script?

THIS_SCRIPT=$(readlink -f $0)开发者_开发知识库


It assigns the path of the script to variable THIS_SCRIPT. I checked the readlink manpage, the -f option follows the symlinks in path (if they exist)


$(...) means run the command within and return the output as a string. =, as you probably already know, assigns a string to a variable.

0

精彩评论

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

关注公众号