" in sh script? I saw the following line in sh script: :> /tmp/foo Is there any difference between this line and th...">

What is the meaning of ":>" in sh script?

I saw the following line in sh script:

:> /tmp/foo 

Is there any difference between this line and the next line?

 > /tmp/foo 
+4
source share
1 answer

: is a no-op shell, built-in, always returning the success exit status without outputting anything. This is synonymous with inline true , but shorter.

Both are equivalent, although the first assumes that : may be a placeholder for something in the future.

+3
source

Source: https://habr.com/ru/post/1394144/


All Articles