Go Back   Trackpads Community > General Discussions > Computer and Technology > Web Design

Web Design Forums and discussions on webdesign

Web Design

Reply
 
LinkBack Thread Tools
Old 09-17-2005, 08:00   #1 (permalink)
Toby Inkster
Civilians

 
Default UNIX challenge of the day

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. :-)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Now Playing ~ ./ryan_adams/demolition/13_jesus_dont_touch_my_baby.ogg

 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Trackpads Information
Click to Visit
Old 09-17-2005, 08:00   #2 (permalink)
DoobieDo
Civilians

 
Default Re: UNIX challenge of the day

In article <bv4tv2-6rs.ln1@ophelia.g5n.co.uk>, usenet200509
@tobyinkster.co.uk says...
> 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. :-)
>
>

you haven't sobered up from last night yet?
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-17-2005, 12:00   #3 (permalink)
Matt Probert
Civilians

 
Default Re: UNIX challenge of the day

On Sat, 17 Sep 2005 10:41:31 +0100, Toby Inkster
<usenet200509@tobyinkster.co.uk> 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. :-)

¶--

Er, because the pubs are shut? because there's nothing on TV? Because
you like posting messages to the wrong Usenet group?

Am I warm?

Matt


--
Outbound links to related sites and articles improve your site's search engine ranking.
Find relevant articles to link to at http://www.probertencyclopaedia.com
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-17-2005, 12:00   #4 (permalink)
Matt Probert
Civilians

 
Default Re: UNIX challenge of the day

On Sat, 17 Sep 2005 1012 GMT, DoobieDo <dave@bytext.co.uk> wrote:

¶In article <bv4tv2-6rs.ln1@ophelia.g5n.co.uk>, usenet200509
¶@tobyinkster.co.uk says...
¶> 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. :-)
¶>
¶>
¶you haven't sobered up from last night yet?

LOL!

I hadn't thought of that one!

Matt


--
Outbound links to related sites and articles improve your site's search engine ranking.
Find relevant articles to link to at http://www.probertencyclopaedia.com
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-17-2005, 12:00   #5 (permalink)
Roy Schestowitz
Civilians

 
Default Re: UNIX challenge of the day

__/ [Toby Inkster] on Saturday 17 September 2005 10:41 \__

> 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, although at an
underlying level the machine will handle it differently (not sure to what
extent either). I am trying to think along the lines of overwrite,
recursive copying or even that past story of yours about executive rm -rf
..* as root.

Roy

--
Roy S. Schestowitz | "Lions are like hippie tigers"
http://Schestowitz.com | SuSE Linux | PGP-Key: 74572E8E
2:10pm up 23 days 2:24, 2 users, load average: 2.52, 1.17, 0.78
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-17-2005, 12:00   #6 (permalink)
Steve Sobol
Civilians

 
Default Re: UNIX challenge of the day

Roy Schestowitz wrote:
> __/ [Toby Inkster] on Saturday 17 September 2005 10:41 \__
>
>
>>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.

--
Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED
Company website: http://JustThe.net/
Personal blog, resume, portfolio: http://SteveSobol.com/
E: sjsobol@JustThe.net Snail: 22674 Motnocab Road, Apple Valley, CA 92307
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-17-2005, 16:00   #7 (permalink)
nospam@geniegate.com
Civilians

 
Default Re: UNIX challenge of the day

In: <bv4tv2-6rs.ln1@ophelia.g5n.co.uk>, Toby Inkster <usenet200509@tobyinkster.co.uk> 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. :-)


Oh goody! a unix question! :-)

I can think of a few, generally having to do with timestamps
and/or the file descriptors.

Thats supposedly how one might trim a log:

$ cat /dev/null >log

Or:

$ >log

If another process had 'jukebox.pl' open, and you copied the file,
the opened process might use a different file descriptor pointing
to a file that no longer exists.

Or:

You don't have permission to write to /usr/bin but you do
have write permission to /usr/bin/jukebox.pl ?

The '#' would indicate you have root permission, but some filesystems
have extended attributes and/or network filesystems where even root
doesn't have such access.

Or:

Is jukebox.pl a symlink?

Or:

You want to clobber the data in the original file so it can't be
recovered as easily?

Or:

jukebox.pl is a named pipe used to talk to a daemon process.


Those are the reasons off the top of my head, there are probably other
reasons, probably relating to the directory entry or an open file handle.

Now, here's my question to you, if it's not a named pipe, why transfer
data from tia's home directory to /usr/bin? instead of /usr/local/bin ?
Is 'jukebox.pl' a package from the operating system vendor?

If it is a named pipe, why have it in /usr/bin ?

Jamie
--
http://www.geniegate.com Custom web programming
guhzo_42@lnubb.pbz (rot13) User Management Solutions
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unix - Humor Hannibal Humor 1 04-24-2006 22:12
Unix Hosting Recommendations? O.B. Web Design 3 07-17-2005 20:00
Convert UNIX time to normal cwalker123 Microsoft Applications 1 11-03-2004 20:00
framemaker Unix krishna Microsoft Applications 2 06-15-2004 20:03


Community Information
Options
Quick Options
Trackpads Non-Commercial Ad
Copyright Information Click to Visit
Time
Server Time
All times are GMT -4. The time now is 21:26.
Copyright
Copyright Information
The header is based off of work by Vipixel.com and modified by this site. Trackpads and the Trackpads Logo are both Registered Trademarks of Jason Edwards and cannot be used without prior written permission.  The only exception is as a link back to this site. Trackpads is a private website run by a small legion of volunteers, 3 dogs, 12.5 cats and an army of small, super smart, bio-engineered mice with pointy hats and tutu's. Search Engine Friendly URLs by vBSEO 3.2.0 RC7
Archive Links
Archive Links
Page generated in 0.93174 seconds with 19 queries