[sf-lug] Nope, and nope: Re: > and >> and < and << and |

Rick Moen rick at linuxmafia.com
Mon Aug 8 23:04:46 PDT 2016


Quoting Jim Stockford (jim at well.com):

>     And there's this case
> $ > g
> $ ls
> g
> $ cat g
> $
>     I guess it's an alternative to the  touch
> command for creating an empty file.

Not quite.

$ ls -l .procmail/log
-rw------- 1 rick rick 691730 Aug  8 22:52 .procmail/log
$ > .procmail/log
$ ls -l .procmail/log
-rw------- 1 rick rick 0 Aug  8 22:54 .procmail/log
$ 

Long ago, I discovered (by serendipitous accident) that '> foo'
truncates foo (because: overwrite with null stdout), and have used '>' to
do same, ever since.




More information about the sf-lug mailing list