shell scripts symbol ": >"
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.
精彩评论