Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: UNIX cat and cp

__/ [Steve Sobol] on Saturday 17 September 2005 17:43 \__

> Roy Schestowitz wrote:
> 
>>>>>Why did I just run this command (as root):
>>>>>
>>>>># cat ~tai/jukebox-2.19b.pl >/usr/bin/jukebox.pl
>>>>>
>>>>>instead of this one:
>>>>>
>>>>># cp ~tai/jukebox-2.19b.pl /usr/bin/jukebox.pl
> 
>>>>>I promise you, there is a good reason. :-)
>>>>
>>>>Because it looks more original?
>>>>
>>>>Now truly, it seems like it would achieve the same,
>>>
>>>No it wouldn't.
>>>
>>>The first commandline pipes the output of cp to jukebox.pl and there *is*
>>>no output from the cp command - so it would create an empty file. The
>>>second commandline actually copies the file.
>> 
>> I have just done a little test, but I still fail to see why it would
>> create an empty file. It doesn't. The number of arguments in cat is
>> unconstrained. In fact, for the past month I have been concatenating
>> dozens of files per day using 'cat'.
> 
> Bah.
> 
> I looked at "cat" and read "cp" on that first commandline.
> 
> No, assuming that you're working with text files, there isn't any
> difference.

Ahh... okay. It all makes sense now...

<whisper type="veryquiet">serenity now, serenity now</whisper><b>SERENITY
NOW!!</b>

Roy

-- 
Roy S. Schestowitz      | "How do I set my laser printer on stun?"
http://Schestowitz.com  |    SuSE Linux    |     PGP-Key: 74572E8E
  5:45pm  up 23 days  5:59,  2 users,  load average: 0.29, 0.34, 0.43

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index