file\" in the script, I dint understand the meaning, can any tell me what\'s the command doing?" />
开发者

shell scripts symbol ": >"

开发者 https://www.devze.com 2023-02-08 07:11 出处:网络
I m a newbie at shell scripting, recent开发者_StackOverflow中文版ly I saw a command \": > file\" in the script, I dint understand the meaning, can any tell me what\'s the command doing?

I m a newbie at shell scripting, recent开发者_StackOverflow中文版ly I saw a command ": > file" in the script, I dint understand the meaning, can any tell me what's the command doing?

Thanks, in advance


: is a no-op. > is a redirection, so the file is overwritten with the output from the no-op command (i.e. the file exists and is empty afterwards).


It creates and/or empties the file. The : command is a bash built-in that just does nothing.

0

精彩评论

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