Creating a file in csh

Alexis Dimitriadis alexis at reed.UUCP
Tue Apr 30 13:40:47 AEST 1985


>> What's wrong with "touch filename" ?
>
>As the originator of this mess ... 
>
>The problem with "touch filename" is that the file isn't gauranteed
>to be empty.
>
>The solution I like best came from Peter Honeyman,
>
>     alias \> tee \!* \</dev/null 
>
>(I think that's how it went.  It was that general idea anyway)
>
>
>Now, don't y'all think this has gone on far enough?  

  For an April fool's joke, it has certainly had enough discussion.  But
given the bizarre ways some folks routinely employ to create an empty
file, (see above :-), I think the discussion was not without merit.

To summarise:  
  The most convenient way to create empty files in both
shells is by using the shell's own output redirection facilities-- there
is no need to involve other programs. For the Bourne shell, that is done
simply with 

> file

With cshell, you can use

:> file
(I believe the : is part of an empty label), or use 
echo > file
(The cshell executes echo directly, the Bourne shel doesn't.  And, you
need not use "echo -n", the cshell echo does not append a newline when
there are no arguments).

Forgive me if I am redundant, forgive me if I am redundant,
Alexis Dimitriadis.
-- 
_______________________________________________
  As soon as I get a regular job, the opinions expressed above
will attach themselves to my employer, who will never be rid of
them again.

	  alexis @ reed
	...ihnp4!{harvard|tektronix}!reed
	...decvax!tektronix!reed
	...teneron!reed



More information about the Comp.unix mailing list