Thread View: news.software.readers
20 messages
20 total messages
Started by James Goetz u
Tue, 28 Feb 1995 18:39
Re: how do I get it?
Author: James Goetz u
Date: Tue, 28 Feb 1995 18:39
Date: Tue, 28 Feb 1995 18:39
17 lines
1260 bytes
1260 bytes
Donald Krieger (don@neuronet.pitt.edu) wrote: : Please excuse if I missed the obvious. : : Where do I find it? : : Thanks. From your shell prompt, type in cat /dev/null It should be shown on your screen. If you are afraid of it scrolling off the screen before you can read it, try cat /dev/null | more =O.| fled =O
Re: how do I get it?
Author: Randal L. Schwartz
Date: Wed, 01 Mar 1995 05:44
Date: Wed, 01 Mar 1995 05:44
19 lines
1541 bytes
1541 bytes
>>>>> "James" == James Goetz u <goet8570@mach1.wlu.ca> writes: James> cat /dev/null | more This is a Useless Use Of Cat. This should be: more /dev/null Or, you could do this with perl as: perl -e 'exec "more /dev/null"' :-) -- Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095 Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com) Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>
Re: how do I get it?
Author: Jeff Uphoff
Date: Thu, 02 Mar 1995 00:28
Date: Thu, 02 Mar 1995 00:28
23 lines
1793 bytes
1793 bytes
"RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes: >>>>>> "James" == James Goetz u <goet8570@mach1.wlu.ca> writes: James> cat /dev/null | more RLS> This is a Useless Use Of Cat. This should be: RLS> more /dev/null RLS> Or, you could do this with perl as: RLS> perl -e 'exec "more /dev/null"' I've always loved inflicting 'perl -n /dev/zero' on a box. Great malloc() bomb, and makes a nice gift! --Up. -- Jeff Uphoff - systems/network admin. | juphoff@nrao.edu National Radio Astronomy Observatory | jeff.uphoff@linux.org Charlottesville, VA, USA | http://linux.nrao.edu/~juphoff/
Re: how do I get it?
Author: Sven C. Dack
Date: Fri, 03 Mar 1995 11:20
Date: Fri, 03 Mar 1995 11:20
18 lines
1351 bytes
1351 bytes
Randal> This is a Useless Use Of Cat. This should be:
Randal> more /dev/null
Randal> Or, you could do this with perl as:
Randal> perl -e 'exec "more /dev/null"'
Randal> :-)
Try this:
dd if=/dev/null of=`tty`
Sven
--
LOAD "EMACS",8,1
Re: how do I get it?
Author: Raj Karamchedu
Date: Sun, 05 Mar 1995 00:11
Date: Sun, 05 Mar 1995 00:11
34 lines
1767 bytes
1767 bytes
Randal L. Schwartz (merlyn@stonehenge.com) wrote:
: >>>>> "James" == James Goetz u <goet8570@mach1.wlu.ca> writes:
: James> cat /dev/null | more
: This is a Useless Use Of Cat. This should be:
: more /dev/null
: Or, you could do this with perl as:
: perl -e 'exec "more /dev/null"'
: :-)
: --
: Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
: Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
: Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
: Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>
What's wrong? :(
plasma{233}file /dev/null
/dev/null: character special (3/2)
plasma{234}cat /dev/null
plasma{235}more /dev/null
/dev/null is not a regular file
plasma{236}
-Raj
Re: how do I get it?
Author: Joshua R. Poulson
Date: Sun, 05 Mar 1995 19:13
Date: Sun, 05 Mar 1995 19:13
15 lines
1366 bytes
1366 bytes
In article <3javk0$l8k@fcca.fcca.csi.com>, Raj Karamchedu <raj@csi.com> wrote:
>What's wrong? :(
>plasma{233}file /dev/null
>/dev/null: character special (3/2)
>plasma{234}cat /dev/null
>plasma{235}more /dev/null
>/dev/null is not a regular file
>plasma{236}
Your version of "more" is too smart to read a file that it cannot
identify as a text file.
--
Joshua R. Poulson, jrp@teleport.com, http://www.teleport.com/~jrp/jrp.html
Re: how do I get it?
Author: Greg Berigan
Date: Mon, 06 Mar 1995 00:46
Date: Mon, 06 Mar 1995 00:46
35 lines
1947 bytes
1947 bytes
In news.software.readers, raj@plasma (Raj Karamchedu) writes:
>Randal L. Schwartz (merlyn@stonehenge.com) wrote:
>>James Goetz u <goet8570@mach1.wlu.ca> writes:
>>> cat /dev/null | more
>>This is a Useless Use Of Cat. This should be:
>> more /dev/null
>>
>>Or, you could do this with perl as:
>>
>> perl -e 'exec "more /dev/null"'
>What's wrong? :(
>
>plasma{233}file /dev/null
>/dev/null: character special (3/2)
>plasma{234}cat /dev/null
>plasma{235}more /dev/null
>/dev/null is not a regular file
>plasma{236}
The problem is that /dev/null is for output, not input. You use
/dev/zero for reading. Thus:
cat /dev/zero >/dev/null
A common mistake.
--
----' gberigan@cse.unl.edu (Greg Berigan)
------,
,-|-, "Some say he's the devil himself." "I heard he was _
----' '-' a giant chicken!" -- Highlander Boo: The Chickening d b CC
Re: how do I get it?
Author: Philippe McLean
Date: Mon, 06 Mar 1995 19:04
Date: Mon, 06 Mar 1995 19:04
19 lines
1530 bytes
1530 bytes
In article <3jdm0q$e0j@crcnis3.unl.edu> gberigan@cse.unl.edu (Greg Berigan) writes: [stuff deleted] |> The problem is that /dev/null is for output, not input. You use |> /dev/zero for reading. Thus: |> |> cat /dev/zero >/dev/null |> |> A common mistake. Really? /dev/zero doesn't return end of file when you read from it. What is /dev/zero? Philippe McLean
Re: how do I get it?
Author: Hume C.L. Smith
Date: Mon, 06 Mar 1995 19:30
Date: Mon, 06 Mar 1995 19:30
33 lines
2058 bytes
2058 bytes
>>>>> "PM" == Philippe McLean <pmclean@virgo.drao.nrc.ca> writes: PM> In article <3jdm0q$e0j@crcnis3.unl.edu> gberigan@cse.unl.edu (Greg Berigan) writes: PM> [stuff deleted] PM> |> The problem is that /dev/null is for output, not input. You use PM> |> /dev/zero for reading. Thus: PM> |> PM> |> cat /dev/zero >/dev/null PM> |> PM> |> A common mistake. PM> Really? /dev/zero doesn't return end of file when you read from it. PM> What is /dev/zero? /dev/null reads as a zero-length file. /dev/null writes as a black hole. /dev/zero reads as an infinite-length file of NULs. cat /dev/zero > /dev/null will never stop on its own. PM> Philippe McLean duh, that's assuming you HAVE /dev/zero on your system; i don't! -- Hume Smith hclsmith@ra.isisnet.com "Like, don't I have the cutest toes, or some junk?" Shirley
Re: how do I get it?
Author: Larry Wall
Date: Mon, 06 Mar 1995 20:44
Date: Mon, 06 Mar 1995 20:44
22 lines
1427 bytes
1427 bytes
In article <DACK.95Mar3122000@hessen.darmstadt.gmd.de>, Sven C. Dack <dack@darmstadt.gmd.de> wrote: : Randal> This is a Useless Use Of Cat. This should be: : : Randal> more /dev/null : : Randal> Or, you could do this with perl as: : : Randal> perl -e 'exec "more /dev/null"' : : Randal> :-) : : Try this: : : dd if=/dev/null of=`tty` But that won't be equivalent when /dev/null contains more than a page's worth of lines. You'll have to do better than that. Larry Wall lwall@netlabs.com
Re: how do I get it?
Author: Drew Justin Asson
Date: Mon, 06 Mar 1995 21:45
Date: Mon, 06 Mar 1995 21:45
38 lines
2511 bytes
2511 bytes
>>>>> On 06 Mar 1995 19:04:48 GMT, pmclean@virgo.drao.nrc.ca (Philippe McLean) said:
In article <PMCLEAN.95Mar6110448@virgo.drao.nrc.ca> pmclean@virgo.drao.nrc.ca (Philippe McLean) writes:
>In article <3jdm0q$e0j@crcnis3.unl.edu> gberigan@cse.unl.edu (Greg Berigan) writes:
>[stuff deleted]
>|> The problem is that /dev/null is for output, not input. You use
>|> /dev/zero for reading. Thus:
>|>
>|> cat /dev/zero >/dev/null
>|>
>|> A common mistake.
>Really? /dev/zero doesn't return end of file when you read from it.
>What is /dev/zero?
You don't need /dev/zero for stdin. I use on a regular basis:
program_name < /dev/null > /tmp/log-file
/dev/zero returns an infinite buffer full of zeros. Writes are ignored,
but successful, to it. See man page for zero (4s). (i.e. 'man 4s zero').
Drew
--
=========================================
Drew J. Asson, Sr. S/W Engr -- SST
Space Telescope Science Institute
(410) 338-4474, Fax: (410) 338-1592
=========================================
STScI: asson@stsci.edu
Newton: DrewJAsson (@eworld.com)
http://chacmool.stsci.edu:8001/asson.html
=========================================
Re: how do I get it?
Author: Greg Berigan
Date: Tue, 07 Mar 1995 03:47
Date: Tue, 07 Mar 1995 03:47
83 lines
3338 bytes
3338 bytes
In news.software.readers, pmclean@virgo.drao.nrc.ca (Philippe McLean) writes:
>gberigan@cse.unl.edu (Greg Berigan) writes:
>>The problem is that /dev/null is for output, not input. You use
>>/dev/zero for reading. Thus:
>>
>> cat /dev/zero >/dev/null
>>
>>A common mistake.
>Really? /dev/zero doesn't return end of file when you read from it.
Exactly. /dev/zero is by design a file of infinite length. On
/dev/zero you can read forever.
>What is /dev/zero?
From the IRIX 5.3 manpages for zero and null:
|ZERO(7) ZERO(7)
|
|
|
|NAME
| zero - source of zeroes
|
|DESCRIPTION
| A zero special file is a source of zeroed unnamed memory.
|
| Reads from a zero special file always return a buffer full of zeroes.
| The file is of infinite length.
|
| Writes to a zero special file are always successful, but the data written
| is ignored.
|
| Mapping a zero special file creates a zero-initialized unnamed memory
| object of a length equal to the length of the mapping and rounded up to
| the nearest page size as returned by getpagesize(2). Multiple processes
| can share such a zero special file object provided a common ancestor
| mapped the object MAP_SHARED.
|
|FILES
| /dev/zero
|
|SEE ALSO
| fork(2), mmap(2)
|
| Page 1
That leaves no doubt that /dev/zero is designed for reading.
|NULL(7) NULL(7)
|
|
|
|NAME
| null - the null file
|
|DESCRIPTION
| Data written on the null special file, /dev/null, is discarded.
|
| Reads from a null special file always return 0 bytes.
|
|FILES
| /dev/null
|
| Page 1
A little ambiguous in whether "0 bytes" means null bytes or no bytes.
Like how a dictionary lists the most common and/or preferred spelling
first when listing various spellings for a word, so does this man page
list the primary purpose of our null device.
[Manpages copyright 1987-1994 Silicon Graphics, Inc., All Rights
Reserved. IRIX is a trademark of Silicon Graphics, Inc. ]
--
----' gberigan@cse.unl.edu (Greg Berigan)
------,
,-|-, "Some say he's the devil himself." "I heard he was _
----' '-' a giant chicken!" -- Highlander Boo: The Chickening d b CC
Re: how do I get it?
Author: Thomas Quinot
Date: Tue, 07 Mar 1995 14:54
Date: Tue, 07 Mar 1995 14:54
22 lines
1670 bytes
1670 bytes
Greg Berigan <gberigan@cse.unl.edu> ๏ฟฝcrit :
> >plasma{235}more /dev/null
> >/dev/null is not a regular file
> >plasma{236}
> The problem is that /dev/null is for output, not input. You use
> /dev/zero for reading. Thus:
Hum...
melchior:~$ more /dev/zero
/dev/zero is not a regular file
But...
melchior:~$ cat /dev/null|more
line ?/? (END)
--> You can perfectly read from /dev/null (though it will be at EOF...)
--
Thomas.Quinot@melchior.frmug.fr.net | Linux : the choice of a GNU generation
Re: how do I get it?
Author: Hans Mulder
Date: Tue, 07 Mar 1995 15:30
Date: Tue, 07 Mar 1995 15:30
36 lines
1879 bytes
1879 bytes
In <3javk0$l8k@fcca.fcca.csi.com> raj@plasma (Raj Karamchedu) writes:
>Randal L. Schwartz (merlyn@stonehenge.com) wrote:
>: >>>>> "James" == James Goetz u <goet8570@mach1.wlu.ca> writes:
>: James> cat /dev/null | more
>: This is a Useless Use Of Cat. This should be:
>: more /dev/null
>: Or, you could do this with perl as:
>: perl -e 'exec "more /dev/null"'
>What's wrong? :(
>plasma{235}more /dev/null
>/dev/null is not a regular file
You have aliased "more" to "less". "Less" is generally more
usable than "more", but it suffers from this strange aversion
against irregular files. Use:
\more /dev/null
or
perl -e 'exec "more /dev/null"'
The perl "exec" operator passes its argument to the Bourne shell,
so it is unaffected by your aliases.
--
Not speaking for the Campaign Against Gratuitous Abuse of `Cat',
HansM print 1->[@{!@!}=q\Just another dog catcher,\,<=>]
Re: how do I get it?
Author: Ulrich Ring
Date: Thu, 09 Mar 1995 08:33
Date: Thu, 09 Mar 1995 08:33
13 lines
1252 bytes
1252 bytes
Hume C.L. Smith (stu7x93@bmerhaeb.bnr.ca) wrote: : cat /dev/zero > /dev/null will never stop on its own. : -- : Hume Smith hclsmith@ra.isisnet.com I strongly recommend cat /dev/zero | compress > /dev/null Ulrich
Re: how do I get it?
Author: George Nassiopoulos P-353 495-71...
Date: Thu, 09 Mar 1995 18:05
Date: Thu, 09 Mar 1995 18:05
21 lines
1818 bytes
1818 bytes
Greg Berigan (gberigan@cse.unl.edu) wrote:
: The problem is that /dev/null is for output, not input. You use
: /dev/zero for reading. Thus:
: cat /dev/zero >/dev/null
Huh? excuse me but what are you talking about? Since when is
/dev/null not for reading?
If i want an empty file, i.e. a file that returns EOF and nothing
else then i "cat /dev/null"...
e.g. "cat /dev/null | awk '{....}'
"cat /dev/zero" does not return EOF, it returns an infinite number
of \0's. Take a look at the man pages for "zero" and "null"...
George Nassiopoulos
nassio@cfa.harvard.edu
Re: how do I get it?
Author: Hans Mulder
Date: Fri, 10 Mar 1995 13:11
Date: Fri, 10 Mar 1995 13:11
28 lines
1818 bytes
1818 bytes
In <D56q9s.G1@cfanews.harvard.edu> nassio@cfassp16 (George Nassiopoulos P-353 495-7181) writes:
:Greg Berigan (gberigan@cse.unl.edu) wrote:
:: The problem is that /dev/null is for output, not input. You use
:: /dev/zero for reading. Thus:
:: cat /dev/zero >/dev/null
:Huh? excuse me but what are you talking about? Since when is
:/dev/null not for reading?
:If i want an empty file, i.e. a file that returns EOF and nothing
:else then i "cat /dev/null"...
: e.g. "cat /dev/null | awk '{....}'
What's wrong with
awk '{....}' /dev/null
????
--
Not speaking for the Campaign Against Gratuitous Abuse of `Cat',
HansM print 1->[@{!@!}=q\Just another dog catcher,\,<=>]
Re: how do I get it?
Author: Michael P Mullaney
Date: Fri, 10 Mar 1995 23:53
Date: Fri, 10 Mar 1995 23:53
22 lines
1472 bytes
1472 bytes
In article <PMCLEAN.95Mar6110448@virgo.drao.nrc.ca> pmclean@virgo.drao.nrc.ca (Philippe McLean) writes: >In article <3jdm0q$e0j@crcnis3.unl.edu> gberigan@cse.unl.edu (Greg Berigan) writes: > >[stuff deleted] > >|> The problem is that /dev/null is for output, not input. You use >|> /dev/zero for reading. Thus: >|> >|> cat /dev/zero >/dev/null >|> >|> A common mistake. > >Really? /dev/zero doesn't return end of file when you read from it. > >What is /dev/zero? > > >Philippe McLean >
Re: how do I get it?
Author: John Porter
Date: Mon, 13 Mar 1995 17:26
Date: Mon, 13 Mar 1995 17:26
55 lines
2621 bytes
2621 bytes
In article <3jdm0q$e0j@crcnis3.unl.edu>,
Greg Berigan <gberigan@cse.unl.edu> wrote:
>
>The problem is that /dev/null is for output, not input. You use
>/dev/zero for reading. Thus:
>
> cat /dev/zero >/dev/null
>
>A common mistake.
According to the Sun 4.1 man pages:
NULL(4) DEVICES AND NETWORK INTERFACES NULL(4)
FILES
/dev/null
DESCRIPTION
Data written on the null special file is discarded.
Reads from the null special file always return an end-of-
file indication.
And:
ZERO(4S) DEVICES AND NETWORK INTERFACES ZERO(4S)
FILES
/dev/zero
DESCRIPTION
A zero special file is a source of zeroed unnamed memory.
Reads from a zero special file always return a buffer full
of zeroes. The file is of infinite length.
Writes to a zero special file are always successful, but the
data written is ignored.
Mapping a zero special file creates a zero-initialized
unnamed memory object of a length equal to the length of the
mapping and rounded up to the nearest page size as returned
by getpagesize(2). Multiple processes can share such a zero
special file object provided a common ancestor mapped the
object MAP_SHARED.
So, while /dev/zero may do what you say it does, I don't
think that's what it was intended for.
And your assertion that "/dev/null is for output, not input" is false.
john porter
jporter@btg.com
Re: how do I get it?
Author: Greg Berigan
Date: Mon, 13 Mar 1995 21:39
Date: Mon, 13 Mar 1995 21:39
28 lines
2185 bytes
2185 bytes
In news.software.readers, jporter@elara.btg.com (John Porter) writes:
>Greg Berigan <gberigan@cse.unl.edu> wrote:
>>The problem is that /dev/null is for output, not input. You use
>>/dev/zero for reading. Thus:
>>
>> cat /dev/zero >/dev/null
>>
>>A common mistake.
>According to the Sun 4.1 man pages:
AAAAARRRRGGGGGHHHHH!!!!!! Why can't people read the whole thread before
responding!!!
>So, while /dev/zero may do what you say it does, I don't
>think that's what it was intended for.
>And your assertion that "/dev/null is for output, not input" is false.
But doing cat /dev/null is like inhaling through a vacuum cleaner hose.
There's no point to it, which is why I recommended using /dev/zero.
--
----' gberigan@cse.unl.edu (Greg Berigan)
------,
,-|-, "Some say he's the devil himself." "I heard he was _
----' '-' a giant chicken!" -- Highlander Boo: The Chickening d b CC
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads