Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

what is /usr/bin/head

by richill (Monk)
on May 23, 2006 at 00:36 UTC ( [id://551062]=perlquestion: print w/replies, xml ) Need Help??

richill has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks I'm installing fink and got this perl related error. It's correct in that I have just installed libwww. But how do I restore /usr/bin/head and what is it? If this question is on the wrong board I apologise.
Found perl version 5.008001. Checking package... looks good. Checking system... powerpc-apple-darwin7.9.0 This system was not released at the time this Fink release was made, b +ut should work. Distribution 10.3 Checking cc... looks good. Checking make... looks good. Checking head... is broken. ERROR: /usr/bin/head seems to be corrupted. This can happen if you man +ually installed Perl libwww. You'll have to restore /usr/bin/head from anoth +er machine or from installation media.

Replies are listed 'Best First'.
Re: what is /usr/bin/head
by dynamo (Chaplain) on May 23, 2006 at 01:19 UTC
    I believe the head utility is the opposite of the tail utility, which is more well known. It returns the top of a file, basically.

    See Wikipedia for more. As for why yours is broken, do a google search for "darwin bin head" for some ideas.. it seems a lot of utilities overwrite it. If you have another mac around, copy it.

      Hi

      I believe the head utility is the opposite of the tail utility

      This is exactly opposite to tail utility. Refere more on head.

      "Keep pouring your ideas"
Re: what is /usr/bin/head
by ysth (Canon) on May 23, 2006 at 01:24 UTC
    And the connection to Perl libwww is that that has a HEAD utility that will conflict on a non-case-sensitive filesystem. The lower-cased head is a unix utility; in the GNU utilities, it is part of coreutils.
      Thank you for making it clearer. Is it correct to say that every unix utility must have unique name?
        If they are all going to live in the same directory, yes.

        HEAD (and GET and POST) are optional extras in libwww-perl; they are just aliases to the lwp-response script and aren't even built by default. head, on the other hand, is a fairly basic utility that should always be around, and all kinds of shell scripts can be expected to break if it isn't.

Re: what is /usr/bin/head
by superfrink (Curate) on May 23, 2006 at 03:00 UTC
    When you encounter a unix command and you don't know what it is you can try googling for man head or run "man head" on your unix box.

    PS: My experience is to beware of using the unix command line tools on OSX. The cp command does not copy the filesystem meta-data associated with a file. This can make some quicktime video files impossible to play due to removing codec information.

      Actually, that's not true under 10.4 ... well, at least, it copies the resource fork. For earlier versions of MacOS, you'll want to install the developer tools, and set aliases for cp and mv to 'CpMac' and 'MvMac'

      (and yes, I had some file corruption problems under 10.2, until someone told me what was going on ... empty preferences files for some applications can cause them to lock up in new and interesting ways)

      Oh -- and MacOS stores a _lot_ of metadata for files. (besides just the resource fork, which will can break some files, there's also indexing information, ACLs, and a bunch of stuff that might not be as noticable) ... there's a table of MacOS backup software that might be useful for whole volumes, but I don't know how useful it is for moving individual files.

      update: you'll also notice when creating tarballs or moving to non-HFS systems that you'll get two items for every file -- the data fork under the original name, and one prefixed with '._', which is the resource fork. (just ran into the problem yesterday, when someone grabbed a power point presentation off a memory stick, and grabbed the wrong fork)

Re: what is /usr/bin/head
by jesuashok (Curate) on May 23, 2006 at 02:49 UTC
    Hi

    ERROR: /usr/bin/head seems to be corrupted. This can happen if you manually installed Perl libwww. You'll have to restore /usr/bin/head from another machine or from installation media.

    Refer more details regarding this error from Give me /usr/bin/head!

    "Keep pouring your ideas"
      Yet another example of why every Unix hacker should be running OSX on a case sensitive filesystem like HFSX. Just be prepared for some crusty Mac software to fail (like some versions of Photoshop) that have bugs masked by a case-insensitive filesystem.
      +1 for using the phrase "Give me /usr/bin/head!"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://551062]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-16 17:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found