[NTLUG:Discuss] How do I make all files in a directory of zero length?

Fred James fredjame at concentric.net
Wed Jun 6 13:49:52 CDT 2001


Short might be "pretty", but be careful - know your context.
Something like that suggested by George adds a bit of protection.

Lance Simmons wrote:
> 
> On Wed, Jun 06, 2001 at 12:43:20PM -0500, Fred James wrote:
> >
> > How do you define "pretty"?
> 
> I think I meant "short".
> 
>  cat /dev/null > *
> 
> could be rewritten as
> 
>  > *
> 
> That's short, but doesn't work.
> 
> The best solution so far is:
> 
>  for i in *; do > $i; done
> 
> Is there a shorter solution?
> 
> --
>   .~.
>   /v\   Lance Simmons
>  // \\  lance at lsimmons.net
> /(   )\
> __^_^________________________________________________________________________
> The problem with graduate students, in general, is that they have
> to sleep every few days.
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss

-- 
...small is beautiful...



More information about the Discuss mailing list