sdo@u1100a.UUCP (Scott Orshan) (04/02/85)
On every UNIX system I have ever used, there is no way to prevent the echo command from printing its arguments. I would like to propose a "-q" option to echo which tells it to be quiet and go about its work without printing its arguments. -- Scott Orshan Bell Communications Research 201-981-3064 {ihnp4,allegra,bellcore,pyuxww}!u1100a!sdo
ark@alice.UUCP (Andrew Koenig) (04/02/85)
> On every UNIX system I have ever used, there is no way to prevent > the echo command from printing its arguments. I would like to > propose a "-q" option to echo which tells it to be quiet and go about > its work without printing its arguments. > -- > > Scott Orshan > Bell Communications Research > 201-981-3064 > {ihnp4,allegra,bellcore,pyuxww}!u1100a!sdo > This option is unnecessary because you can obtain the equivalent effect by redirecting the standard output: echo $args >/dev/null Doing it this way has the advantage of greater portability, too.
veach@ihuxl.UUCP (Michael T. Veach) (04/02/85)
> On every UNIX system I have ever used, there is no way to prevent > the echo command from printing its arguments. I would like to > propose a "-q" option to echo which tells it to be quiet and go about > its work without printing its arguments. > -- > > Scott Orshan > Bell Communications Research > 201-981-3064 > {ihnp4,allegra,bellcore,pyuxww}!u1100a!sdo What other work does echo have besides printing its arguments? -- Michael T. Veach ihuxl!veach
henry@utzoo.UUCP (Henry Spencer) (04/03/85)
> ... I would like to > propose a "-q" option to echo which tells it to be quiet and go about > its work without printing its arguments. Shush! Don't say that where Berkeley or AT&T can hear you, or they'll do it for the next release! "/dev/null ? Never heard of it. Gotta have a -q option." -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry
steve@tellab3.UUCP (Steve Harpster) (04/03/85)
Shouldn't this be in net.jokes? If echo didn't print its arguments, what good would it be?!? I mean, what else does your version do? Can you give me an example of how you would use your `-q' option? -- ...ihnp4!tellab1!steve Steve Harpster Tellabs, Inc.
sdo@u1100a.UUCP (Scott Orshan) (04/03/85)
In article <797@u1100a.UUCP> I wrote: >On every UNIX system I have ever used, there is no way to prevent >the echo command from printing its arguments. I would like to >propose a "-q" option to echo which tells it to be quiet and go about >its work without printing its arguments. >-- > > Scott Orshan OK. I've gotten enough replies. April Fool. Most people realized this and answered in the spirit of the day. However, I don't blame those who took it seriously - it resembles many of the legitimate articles posted here. It's also a take-off on "cat -v" Most of the answers said to use "echo arg ... >/dev/null" A better answer (since it doesn't involve opening /dev/null) was "echo '\c' arg ..." (In the USG echo, \c is used as "-n" is used in BSD). -- Scott Orshan Bell Communications Research 201-981-3064 {ihnp4,allegra,bellcore,pyuxww}!u1100a!sdo
jdb@hou5f.UUCP (John Bell) (04/03/85)
Excuse me for being confused, but I thought that echo was SUPPOSED to print its arguments. If you mean to put its args into another place, use shell I/O redirection: "echo foo bar baz >some.other.file" Of course, that file could be "/dev/null" if you really want to discard the results (???) -- ~~~~~~~~~~~~~~~~~~~~ John D. Bell, AT&T-ISL Holmdel, NJ 1J317 (201) 834-3372 UUCP: ...{ihnp4,hou??,ucbvax}!hou5f!jdb "...You may be right, I may be crazy, but it just may be a lunatic you're looking for..." -Billy Joel
schnable@ihuxo.UUCP (Andrew T. Schnable) (04/03/85)
> On every UNIX system I have ever used, there is no way to prevent > the echo command from printing its arguments. I would like to > propose a "-q" option to echo which tells it to be quiet and go about > its work without printing its arguments. > -- > > Scott Orshan > Bell Communications Research > 201-981-3064 > {ihnp4,allegra,bellcore,pyuxww}!u1100a!sdo Great idea. Maybe cat(1) needs this argument too. Heck, If we add it to everything, we may be able to do away with /dev/null! andy ihuxo!schnable
dan@rna.UUCP (Dan Ts'o) (04/03/85)
In article <> veach@ihuxl.UUCP (Michael T. Veach) writes: >What other work does echo have besides printing its arguments? Well, lots By studying the differential CPU usage between "echo" and "echo hello" one can deduce the CPU time required for the shell to set up arguments. A -q option would facilitate this study. It is an idea command name with which to practice touch typing. It is a command which is easy to learn. It exercises the disk. It is a firm base for an April 1 ruse.
gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (04/06/85)
> On every UNIX system I have ever used, there is no way to prevent > the echo command from printing its arguments. I would like to > propose a "-q" option to echo which tells it to be quiet and go about > its work without printing its arguments. Are you serious?
david@ukma.UUCP (David Herron, NPR Lover) (04/06/85)
>Shouldn't this be in net.jokes? If echo didn't print its arguments, >what good would it be?!? I mean, what else does your version do? >Can you give me an example of how you would use your `-q' option? Ok.... echo -q This creates an empty file >new.file Since, with csh, there is no longer an easy way to create an empty file. (With sh one could type just ">new.file"). -- --- David Herron --- ARPA-> ukma!david<@ANL-MCS> or david%ukma.uucp@anl-mcs.arpa --- Or even anlams!ukma!david@ucbvax.arpa --- UUCP-> {ucbvax,unmvax,boulder,oddjob}!anlams!ukma!david --- cbosgd!ukma!david "The home of poly-unsaturated thinking".
roy@phri.UUCP (Roy Smith) (04/08/85)
> Since, with csh, there is no longer an easy way to create an empty
Uh, how about "cp /dev/null new-empty-file"?
--
cmcl2!rocky2!cubsvax -\
vax135!timeinc -> !phri!roy (Roy Smith, System Administrator)
allegra -/
The opinions expressed herein do not necessarily reflect
the views of the Public Health Research Institute.
hopp@nbs-amrf.UUCP (Ted Hopp) (04/09/85)
> > Can you give me an example of how you would use your `-q' option? > > echo -q This creates an empty file >new.file > > Since, with csh, there is no longer an easy way to create an empty > file. (With sh one could type just ">new.file"). > > --- David Herron But "echo > new.file" works just fine with our csh. (Eunice 3.2; a.k.a. ersatz BSD 4.1). -- Ted Hopp {seismo,umcp-cs}!nbs-amrf!hopp
jordan@ucbvax.ARPA (Jordan Hayes) (04/10/85)
>>Shouldn't this be in net.jokes? If echo didn't print its arguments, >>what good would it be?!? I mean, what else does your version do? >>Can you give me an example of how you would use your `-q' option? >Ok.... > > echo -q This creates an empty file >new.file > >Since, with csh, there is no longer an easy way to create an empty >file. (With sh one could type just ">new.file"). > >-- >--- David Herron Come on... "echo > new.file" or "cat > new.file" with a ^D directly on the next line works fine... some people just can't take a joke.... /jordan ------- ARPA: jordan@berkeley.ARPA UUCP: ..!ucbvax!jordan
edhall@randvax.UUCP (Ed Hall) (04/10/85)
> > Since, with csh, there is no longer an easy way to create an empty
Since csh's built-in echo command doesn't output a newline unless it has
at least one argument, the following creates an empty file quite well:
echo >empty.file
Of course, this means you ahve to give echo a null argument, at least,
if you really *wanted* a newline.
Yet another case of csh trying to be more ``useful'' by adding yet
another piddling feature.
-Ed Hall
decvax!randvax!edhall
dave@circadia.UUCP (David Messer) (04/11/85)
> On every UNIX system I have ever used, there is no way to prevent > the echo command from printing its arguments. I would like to > propose a "-q" option to echo which tells it to be quiet and go about > its work without printing its arguments. Yes, this IS a major flaw in UNIX. I have often wanted to do this. Here is a shell script that I use and hope that you can also use: ------CUT------CUT------CUT------CUT------ #!sh for i in $* do case $i in -q) exit ;; esac done echo $* #:-) -- Dave Messer ...ihnp4!stolaf!umn-cs!circadia!dave
mbk@denning.uucp (Mark B. Kadonoff) (04/13/85)
The easiest way I know of is 'touch new.file'. -- Mark Kadonoff Denning Mobile Robotics, Inc. (617) 935-4840 UUCP: ..!decvax!linus!security!denning!mbk ARPA: denning!mbk@CMU-RI-ROVER
rwl@uvacs.UUCP (Ray Lubinsky) (04/13/85)
> >Shouldn't this be in net.jokes? If echo didn't print its arguments, > >what good would it be?!? I mean, what else does your version do? > >Can you give me an example of how you would use your `-q' option? > > Ok.... > > echo -q This creates an empty file >new.file > > Since, with csh, there is no longer an easy way to create an empty > file. (With sh one could type just ">new.file"). > --- A few people have mentioned just using cp /dev/null new.file but of course this only works for one file at a time. I've had a script around for a while called "wipe" that will create an arbitrary number of zero-length files: #! /bin/sh exec /bin/tee $* < /dev/null [BTW, I hadn't looked at the date of the original posting, either. I must have been reading it before my morning's coffee because I can remember puzzling for a good 30 seconds over why you'd want an echo that didn't print its arguments. :-)] -- ------------------------------------------------------------------------------ Ray Lubinsky University of Virginia, Dept. of Computer Science uucp: decvax!mcnc!ncsu!uvacs!rwl
jsdy@hadron.UUCP (Joseph S. D. Yao) (04/16/85)
> On every UNIX system I have ever used, there is no way to prevent > the echo command from printing its arguments. I would like to > propose a "-q" option to echo which tells it to be quiet and go about > its work without printing its arguments. I don't understand this posting at all. I always thought that "the work" of echo w a s to print its arguments. ;-S Joe Yao hadron!jsdy@seismo.{ARPA,UUCP}
honey@down.FUN (code 101) (04/16/85)
alias '>' 'tee \!* < /dev/null'
this has the advantage of allowing
> f1 f2 ...
peter
peter@rlgvax.UUCP (Peter Klosky) (04/22/85)
trmsg(na) +++ Using echo to put data on the file system can be tricky. +++ The following script would truncate it's file regularly due to +++ the window between the shell performing +++ the i/o redirection and the echo program being invoked, given +++ a signal in the window. if test -f .jobname then lastjob=`cat .jobname` else lastjob=0 fi thisjob=`expr $lastjob + 1` echo $thisjob >.jobname