Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rate Thread Display Modes
Old 09-18-2002, 10:53 PM   #1
js62
Prospect
 
Join Date: Jun 2002
Location: Connecticut, U.S.A.
Posts: 40
Broken "head"

It would seem that my "head" command is broken. Not sure when it happened, I believe it was after I installed the latest Perl. For example here is what happens :

joe% sudo sh /etc/daily
daily run output

Removing scratch and junk files:
rm: ./Mount01: is a directory
rm: ./Mount02: is a directory
rm: ./Mount03: is a directory
rm: ./Mount04: is a directory
rm: ./vi.recover: is a directory
rm: ./zBooterMnt: is a directory

Backing up NetInfo data

Checking subsystem status:

disks:
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/disk1s2 39085800 8336896 30492904 21% /
fdesc 1 1 0 100% /dev
/dev/disk0s2 10032204 3344568 6687636 33% /Volumes/backup

Last dump(s) done (Dump '>' file systems):

mail:
/etc/mail/sendmail.cf: line 93: fileclass: cannot open '/etc/mail/local-host-names': Group writable directory

network:
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lo0 16384 <Link#1> 8099 0 8099 0 0
lo0 16384 127 localhost 8099 - 8099 - -
gif0* 1280 <Link#2> 0 0 0 0 0
stf0* 1280 <Link#3> 0 0 0 0 0
en1 1500 <Link#4> 00:30:65:1f:19:d2 73367 0 51740 0 0
en1 1500 fe80:4::230 fe80:4::230:65ff: 73367 - 51740 - -
en1 1500 10.0.1/24 10.0.1.2 73367 - 51740 - -
en0 1500 <Link#5> 00:30:65:57:e5:aa 0 0 0 0 0
en0 1500 fe80:5::230 fe80:5::230:65ff: 0 - 0 - -

ruptime: no hosts in /var/rwho.

Rotating log files: system.logUnknown option: 1
Usage: head [-options] <url>...
-m <method> use method for the request (default is 'HEAD')
-f make request even if head believes method is illegal
-b <base> Use the specified URL as base
-t <timeout> Set timeout value
-i <time> Set the If-Modified-Since header on the request
-c <conttype> use this content-type for POST, PUT, CHECKIN
-a Use text mode for content I/O
-p <proxyurl> use this as a proxy
-P don't load proxy settings from environment
-H <header> send this HTTP header (you can specify several)

-u Display method and URL before any response
-U Display request headers (implies -u)
-s Display response status code
-S Display response status chain
-e Display response headers
-d Do not display content
-o <format> Process HTML content in various ways

-v Show program version
-h Print this message

-x Extra debugging output
kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]

everything looks ok, except for the broke head.

Thanks in advance.

joe

I'm on a G4/400 running OS X 10.2.1 if that helps. Developer tools that came with Jag are installed. I use CPAN to install Perl modules.
js62 is offline   Reply With Quote
Old 09-18-2002, 11:22 PM   #2
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
that doesn't look like the /usr/bin/head command.

what is your path?

what does

% which head

say?

i'd say that your path has a dir entry ahead of /usr/bin and it contains an executable named head in it that shouldn't be in the mix.
mervTormel is offline   Reply With Quote
Old 09-18-2002, 11:25 PM   #3
js62
Prospect
 
Join Date: Jun 2002
Location: Connecticut, U.S.A.
Posts: 40
Hi Merv,
here's the info

joe% echo $path
/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/vscanx

joe% which head
/usr/bin/head


what does that say about the problem?

Joe
js62 is offline   Reply With Quote
Old 09-18-2002, 11:40 PM   #4
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
I suspect HEAD (not head)

I suspect that this is a difficulty with the case-insensitivity of the HFS file system. I seem to recall that some Perl module installed a sym-link in /usr/bin called "HEAD" which made an HTTP HEAD request. Of course this overwrites the "head" program that is in /usr/bin

If this is the case, your solution is to use Pacifist (or other utility) to grab "head" from the CD and put it back. (Change HEAD to some other name if you want to keep it.)
hayne is offline   Reply With Quote
Old 09-18-2002, 11:53 PM   #5
js62
Prospect
 
Join Date: Jun 2002
Location: Connecticut, U.S.A.
Posts: 40
Thanks I'll give it a try and report back tomorrow evening.

joe
js62 is offline   Reply With Quote
Old 09-19-2002, 01:19 AM   #6
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
Re: I suspect HEAD (not head)

Quote:
Originally posted by hayne
I suspect that this is a difficulty with the case-insensitivity of the HFS file system. I seem to recall that some Perl module installed a sym-link in /usr/bin called "HEAD" which made an HTTP HEAD request. Of course this overwrites the "head" program that is in /usr/bin

thanks, hayne. good catch.

always review 3rd party installs for rogue stomps {sigh}

--
conventions are great! everybody has one!
mervTormel is offline   Reply With Quote
Old 09-19-2002, 08:23 AM   #7
pmccann
Major Leaguer
 
Join Date: Jan 2002
Location: Adelaide, South Australia
Posts: 470
That'll be LWP (library for www programming in perl). I'm almost definite that the latest version of that (group of) module(s) doesn't let the head-banging occur. Hang on...

Yep, things go in /usr/local/bin now, as per this entry in the "Changes" file for "libwww-perl-5.65" distribution.

Quote:
Release 5.65

Try to avoid to default to overwriting /usr/bin/head
on MacOS X when the perl install prefix is /usr/bin.

So now you can have it all: get your head from /usr/bin and get HEAD in /usr/local/bin. Ooh aah!

Cheers,
Paul
pmccann is offline   Reply With Quote
Old 09-19-2002, 08:33 PM   #8
js62
Prospect
 
Join Date: Jun 2002
Location: Connecticut, U.S.A.
Posts: 40
Broken head is fixed!.

Thanks a bunch gang. I was able to rm the offending HEAD and cp the correct head from the Jag install disk to my /usr/bin. Now all is well. For general info it was LWP that caused the problem.
I'm really learning a lot from everyone here.

Joe
js62 is offline   Reply With Quote
Reply


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

Forum Jump



All times are GMT -5. The time now is 06:15 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.