Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.6.2.16 $; site pbear.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!bellcore!decvax!cca!pbear!peterb From: peterb@pbear.UUCP Newsgroups: net.unix Subject: Creating empty files using SH Message-ID: <7500003@pbear.UUCP> Date: Mon, 17-Jun-85 11:17:00 EDT Article-I.D.: pbear.7500003 Posted: Mon Jun 17 11:17:00 1985 Date-Received: Thu, 20-Jun-85 08:59:20 EDT Lines: 25 Nf-ID: #N:pbear:7500003:000:738 Nf-From: pbear!peterb Jun 17 11:17:00 1985 A while ago, somebody asked why people use "cat /dev/null > file" to create empty files, and somebody retorted that touch does the same thing, and then someone replied, "no touch just changes modify times, does no empty the file", etc... I was reading S.R.Bourne's "THe UNIX System", and Bourne covers one of the simplest was of doing it under the bourne shell. The command: for i do >$i ; done creates empty files for each parameter that is supplied, such that if a file contains this command and has execute permissions, the following command create alpha beta will create the two empty files alpha and beta in the current directory and ensure that they are empty. Peter Barada {ihnp4!inmet|{harvard|cca}!ima}!pbear!peterb