chraebsli to Programmer [email protected] • 1 year agoTouch a file in Linuxprogramming.devimagemessage-square94fedilinkarrow-up11.2K
arrow-up11.2KimageTouch a file in Linuxprogramming.devchraebsli to Programmer [email protected] • 1 year agomessage-square94fedilink
minus-square@[email protected]linkfedilink6•1 year ago.“:>>” is “append null” right? Do you get a file with a single ASCII NUL or is it truly empty?
minus-square@[email protected]linkfedilink4•edit-21 year ago$ :|wc -c 0 $ touch /tmp/f; :>>/tmp/f; wc -c /tmp/f 0 /tmp/f
minus-squareTrailblazing Braille Taserlinkfedilink14•1 year agoNot really. I believe : is the “true” builtin. So it’s like running a program that exits with zero and writes nothing to stdout. The >> streams the empty stdout into the named file.
.“:>>” is “append null” right? Do you get a file with a single ASCII NUL or is it truly empty?
$ :|wc -c 0 $ touch /tmp/f; :>>/tmp/f; wc -c /tmp/f 0 /tmp/f
Not really. I believe : is the “true” builtin. So it’s like running a program that exits with zero and writes nothing to stdout. The >> streams the empty stdout into the named file.