cat file > /dev/cua1 vs. cp file /dev/cual ?

cat file > /dev/cua1 vs. cp file /dev/cual ?

Post by Jay Doa » Tue, 12 Nov 1996 04:00:00



The title says it all.  I have a file containing some non-ascii
characters (that I'm using to control an X10 unit on /dev/cua1).  When
I do

cp file /dev/cua1

the command works (the bytes are all sent, evidently).  Wheras

cat file > /dev/cua1

fails.  Can someone tell me the difference between the two?

Thanks,

Jay

--

 
 
 

cat file > /dev/cua1 vs. cp file /dev/cual ?

Post by geor.. » Tue, 12 Nov 1996 04:00:00



>The title says it all.  I have a file containing some non-ascii
>characters (that I'm using to control an X10 unit on /dev/cua1).  When
>I do

>cp file /dev/cua1

>the command works (the bytes are all sent, evidently).  Wheras

>cat file > /dev/cua1

>fails.  Can someone tell me the difference between the two?

>Thanks,

>Jay

  Some of your non-ascii characters may be EOF's in which case 'cat' may
stop before delivering the whole file. (At least the SGI I work on has
this feature...).

-------------------------------------------------------------------------
My opinion only

 
 
 

cat file > /dev/cua1 vs. cp file /dev/cual ?

Post by Warwick Allis » Wed, 13 Nov 1996 04:00:00



>  Some of your non-ascii characters may be EOF's in which case 'cat' may
>stop before delivering the whole file. (At least the SGI I work on has
>this feature...).

This is not true of any normal implementation of cat.  You can cat any
data you like around with cat.  The original poster's problem was caused
by the special behaviour of device files interacting with the way cat
and cp differently access files.

--
Warwick
--

/     * <- Comp Sci Department,     Hackers do it with fewer instructions
\_.-._/    Univ. of Queensland,    ---------------------------------------
     v     Brisbane, Australia.    URL:  http://student.uq.edu.au/~s002434

 
 
 

1. Solaris 8 box: cat file | rsh solaris_2.6_box "cat > /dev/null" SLOW

And the problems seems only happens with the combination of "|" and rsh:

On solaris 8 box:

cat 10MB_file | rsh solaris_2.6_box "cat > /dev/null"

takes forever to finish.

When I did on Solaris 8 box:

ufsdump 0f - / | rsh solaris_2.6_box "cat > /dev/null"

It appears _very_ slow.

The apptrace shows repeated messages:

ufsdump  -> libc.so.1:.mul(0xa, 0x10624dd3, 0x4)
ufsdump  -> libc.so.1:select(nfds = 0x0, readfds = 0x0, writefds = 0x0, errorfds = 0x0, timeout = 0xffbede38) = 0x0
ufsdump  -> libc.so.1:.mul(0xa, 0x10624dd3, 0x4)
ufsdump  -> libc.so.1:select(nfds = 0x0, readfds = 0x0, writefds = 0x0, errorfds = 0x0, timeout = 0xffbede38) = 0x0
ufsdump  -> libc.so.1:.mul(0xa, 0x10624dd3, 0x4)
ufsdump  -> libc.so.1:select(nfds = 0x0, readfds = 0x0, writefds = 0x0, errorfds = 0x0, timeout = 0xffbede38) = 0x0

So it is doing useful work to me.

And the snoop shows:

solaris_8_box -> solaris_2.6_box RSHELL C port=985
solaris_2.6_box -> solaris_8_box RSHELL R port=985
solaris_8_box -> solaris_2.6_box RSHELL C port=985
solaris_2.6_box -> solaris_8_box RSHELL R port=985

Again it does not show useful work to me.

Is this related to IPv6? Can someone help me to verify if this happens
to your box? And a fix? Thanks.

2. "Dream" Machine setup

3. "> file" versus "cp /dev/null file"

4. Linux box as RPRINTER?

5. cp /dev/null or cat /dev/null

6. Is there any way I can program sendmail to return mail from a specific source?

7. /dev/cua1 <-> /dev/ttyS1?

8. internal modems?

9. >/dev/msglog 2<>/dev/msglog </dev/console

10. cat file > /dev/lp0 gives "no such device"

11. Even 'cat file >/dev/lp0' doesn't work

12. cat /dev/mouse > /dev/audio... Newbie Help