Re: [lopsa-tech] > filename

2015-03-19 Thread Brad Beyenhof
On Mar 19, 2015, at 7:34 AM, Brandon Allbery wrote: > > I've noticed that quite a lot of "useless use of cat" comes from folks > reaching conceptually for > > > but having issues with the idea of a command starting with a redirection and > rejecting it instead of moving the redirection.

Re: [lopsa-tech] > filename

2015-03-19 Thread Brandon Allbery
On Thu, Mar 19, 2015 at 10:50 AM, Brad Beyenhof wrote: > For that matter, is there a significant difference between > and > $COMMAND $ARGS ? > > I honestly didn't know about & hadn't tried the former until just now. > Only if there are interacting redirections (e.g. "2>&1 >foo" and ">foo 2>&1"

Re: [lopsa-tech] > filename

2015-03-19 Thread Brandon Allbery
On Fri, Mar 13, 2015 at 11:20 PM, Joe Morris wrote: > hadn't thought of that before -- never liked redirection as the first > character of a command. > I've noticed that quite a lot of "useless use of cat" comes from folks reaching conceptually for http://sinenomine.net

Re: [lopsa-tech] > filename

2015-03-19 Thread Joe Morris
Not so long ago, allber...@gmail.com wrote: > On Fri, Mar 13, 2015 at 8:12 PM, Paul Graydon > wrote: > > > I've always done: > > echo > /path/to/filename > > > > That one's actually a bit unsafe because it writes a newline to the file. > And csh behaves differently from sh. (And then we get into

Re: [lopsa-tech] > filename

2015-03-18 Thread John Borwick
On Fri, Mar 13, 2015 at 1:54 PM, Yves Dorfsman wrote: > > For the past 25 years or so, I've always used: > > cat /dev/null >/path/to/filename > > to empty a file. Somebody just showed me: > > >/path/to/filename > > Is this "new"? I've never seen it before (and I've worked with quite a few

Re: [lopsa-tech] > filename

2015-03-13 Thread Brandon Allbery
On Fri, Mar 13, 2015 at 8:12 PM, Paul Graydon wrote: > I've always done: > echo > /path/to/filename > That one's actually a bit unsafe because it writes a newline to the file. And csh behaves differently from sh. (And then we get into, if you want to suppress the newline, how different echo impl

Re: [lopsa-tech] > filename

2015-03-13 Thread Paul Graydon
Huh.. didn't know either of those. I've always done: echo > /path/to/filename Paul On 3/13/2015 11:00 AM, Robert Hajime Lanning wrote: I tend to use: : > filename Since ":" is no-op. On 03/13/15 10:54, Yves Dorfsman wrote: For the past 25 years or so, I've always used: cat /dev/nu

Re: [lopsa-tech] > filename

2015-03-13 Thread Brandon Allbery
On Fri, Mar 13, 2015 at 1:54 PM, Yves Dorfsman wrote: > to empty a file. Somebody just showed me: > > >/path/to/filename > > > Is this "new"? I've never seen it before (and I've worked with quite a few > sysadmins and devs)... Is this bash vs other shells? I feel weird not > knowing > this. >

Re: [lopsa-tech] > filename

2015-03-13 Thread David Lang
On Fri, 13 Mar 2015, Yves Dorfsman wrote: For the past 25 years or so, I've always used: cat /dev/null >/path/to/filename to empty a file. Somebody just showed me: >/path/to/filename Is this "new"? I've never seen it before (and I've worked with quite a few sysadmins and devs)... Is

Re: [lopsa-tech] > filename

2015-03-13 Thread Robert Hajime Lanning
I tend to use: : > filename Since ":" is no-op. On 03/13/15 10:54, Yves Dorfsman wrote: For the past 25 years or so, I've always used: cat /dev/null >/path/to/filename to empty a file. Somebody just showed me: >/path/to/filename Is this "new"? I've never seen it before (and I'

[lopsa-tech] > filename

2015-03-13 Thread Yves Dorfsman
For the past 25 years or so, I've always used: cat /dev/null >/path/to/filename to empty a file. Somebody just showed me: >/path/to/filename Is this "new"? I've never seen it before (and I've worked with quite a few sysadmins and devs)... Is this bash vs other shells? I feel weird no