Re: Odd 'head' problem

2006-06-16 Thread Joel Rees
I don't recall those questions at all, however it is not at all  
obvious that 'HEAD' is going to replace 'head'. I'm not sure I  
understand the earlier comment about case insensitive filesystems.  
Certainly, OS X is not case insensitive at the CLI level, although  
'Finder' is.


That's complete nonsense, as the simplest test will show:

~ sherm$ echo Hello world  head
~ sherm$ cat HEAD
Hello world

HFS+ is a case-insensitive file system. Finder has nothing  
whatsoever to do with it - it's just a user-level file manager.


base:~ me$ echo hello Mac OS X mailing list  head
base:~ me $ cat HEAD
cat: HEAD: No such file or directory
base:~ me $ cat head
hello Mac OS X mailing list
base:~ me $

;-)

Yes, my boot volume is HFS+, and I have not moved the user  
directories off of it on this machine.


Explanation:

Case sensitivity is a property of the file system, which is separate  
from the shells (both CLI and GUI).


Current versions of Mac OS X (from at least 10.2) allow you to  
specify case sensitivity on both UFS and HFS+ volumes when you  
partition a drive. I always format all my volumes case sensitive,  
except for the volume I keep classic on.


I'm not sure if it's possible to change the case sensitivity when re- 
formatting existing partitions, and it would take more time than I  
want to take right now to check.


As a side note, I prefer to put /usr/local, /www, and similar stuff  
on separate volumes formatted UFS as much as possible. Those are also  
case sensitive, of course.


An even further off-topic complaint, it would be nice to be able to  
make an even finer cut, and put /var/log, /tmp, /var/tmp, etc. on  
separate partitions as damage-limiting measures, but, one, I run out  
of partitions when I do things like dual-boot openbsd, and, two, I  
won't trust Mac OS X's handling of hard or soft links to that level  
until /etc/fstab is respected before autodiskmount or whatever it's  
called kicks in. I've got swap on a separate partition on one of my  
old machines with limited hard disk space, and it definitely speeds  
that old machine up, but I don't recommend playing those tricks on a  
machine that I want to load arbitrary applications on.


(Any Apple people reading the list, please note that there are good  
reasons for allowing /etc/fstab to do its job.)


Odd 'head' problem

2006-06-15 Thread Dennis Putnam
I'm not exactly sure this is what happened but I can't think of  
anything else. After installing several packages from CPAN, my daily  
log maintenance began failing. After some investigation I found that  
'/etc/periodic/daily/500.daily' was getting an error from the '/usr/ 
bin/head' command. When I ran 'head' manually the command was not the  
normal one. It appears that one of the perl packages replaced the  
normal 'head' command that works on files, with one that works on  
URLs. Has anyone encountered this, or can anyone determine if my  
surmise about one of the perl packages is correct? Thanks.


Dennis Putnam
Sr. IT Systems Administrator
AIM Systems, Inc.
11675 Rainwater Dr., Suite 200
Alpharetta, GA  30004
Phone: 678-240-4112
Main Phone: 678-297-0700
FAX: 678-297-2666 or 770-576-1000
The information contained in this e-mail and any attachments is  
strictly confidential. If you are not the intended recipient, any  
use, dissemination, distribution, or duplication of any part of this  
e-mail or any attachment is prohibited. If you are not the intended  
recipient, please notify the sender by return e-mail and delete all  
copies, including the attachments.





Re: Odd 'head' problem

2006-06-15 Thread Dennis Putnam
Thanks, for letting me know I am not nuts. Unfortunately, I've  
already replaced the wrong one with the right one. I guess I need to  
get the perl version from somewhere so I can rename it. Do you know  
which package contains that version? Thanks.


On Jun 15, 2006, at 7:31 AM, Andy Holyer wrote:



On 15 Jun 2006, at 12:22, Dennis Putnam wrote:

I'm not exactly sure this is what happened but I can't think of  
anything else. After installing several packages from CPAN, my  
daily log maintenance began failing. After some investigation I  
found that '/etc/periodic/daily/500.daily' was getting an error  
from the '/usr/bin/head' command. When I ran 'head' manually the  
command was not the normal one. It appears that one of the perl  
packages replaced the normal 'head' command that works on files,  
with one that works on URLs. Has anyone encountered this, or can  
anyone determine if my surmise about one of the perl packages is  
correct? Thanks.


This is a common gotcha on Os X. For some reason which I forget,  
but which I think was due to backwards compatibility with earlier  
versions of MacOs, the standard file system is not case sensitive:  
HEAD and head are considered equivalent.


In the Perl distribution there is a script called HEAD which  
indeed does fetch the header of an HTML file from the web. This  
clashes with the standard Unix head command.


There is a standard workaround, but just renaming the HEAD script  
solves things without (ISTR) breaking too much else.






Dennis Putnam
Sr. IT Systems Administrator
AIM Systems, Inc.
11675 Rainwater Dr., Suite 200
Alpharetta, GA  30004
Phone: 678-240-4112
Main Phone: 678-297-0700
FAX: 678-297-2666 or 770-576-1000
The information contained in this e-mail and any attachments is  
strictly confidential. If you are not the intended recipient, any  
use, dissemination, distribution, or duplication of any part of this  
e-mail or any attachment is prohibited. If you are not the intended  
recipient, please notify the sender by return e-mail and delete all  
copies, including the attachments.





Re: Odd 'head' problem

2006-06-15 Thread Martin Redington


You are (probably) correct.

Its one of the web related cpan packages. LWP maybe, or something  
similar.


It actually installs a command named HEAD rather than head, IIRC, but  
on a case insensitive file system, these are pretty much the same  
thing ...


On 15 Jun 2006, at 12:22, Dennis Putnam wrote:

I'm not exactly sure this is what happened but I can't think of  
anything else. After installing several packages from CPAN, my  
daily log maintenance began failing. After some investigation I  
found that '/etc/periodic/daily/500.daily' was getting an error  
from the '/usr/bin/head' command. When I ran 'head' manually the  
command was not the normal one. It appears that one of the perl  
packages replaced the normal 'head' command that works on files,  
with one that works on URLs. Has anyone encountered this, or can  
anyone determine if my surmise about one of the perl packages is  
correct? Thanks.


Dennis Putnam
Sr. IT Systems Administrator
AIM Systems, Inc.
11675 Rainwater Dr., Suite 200
Alpharetta, GA  30004
Phone: 678-240-4112
Main Phone: 678-297-0700
FAX: 678-297-2666 or 770-576-1000
The information contained in this e-mail and any attachments is  
strictly confidential. If you are not the intended recipient, any  
use, dissemination, distribution, or duplication of any part of  
this e-mail or any attachment is prohibited. If you are not the  
intended recipient, please notify the sender by return e-mail and  
delete all copies, including the attachments.








Re: Odd 'head' problem

2006-06-15 Thread Andy Holyer


On 15 Jun 2006, at 12:22, Dennis Putnam wrote:

I'm not exactly sure this is what happened but I can't think of  
anything else. After installing several packages from CPAN, my  
daily log maintenance began failing. After some investigation I  
found that '/etc/periodic/daily/500.daily' was getting an error  
from the '/usr/bin/head' command. When I ran 'head' manually the  
command was not the normal one. It appears that one of the perl  
packages replaced the normal 'head' command that works on files,  
with one that works on URLs. Has anyone encountered this, or can  
anyone determine if my surmise about one of the perl packages is  
correct? Thanks.


This is a common gotcha on Os X. For some reason which I forget, but  
which I think was due to backwards compatibility with earlier  
versions of MacOs, the standard file system is not case sensitive:  
HEAD and head are considered equivalent.


In the Perl distribution there is a script called HEAD which indeed  
does fetch the header of an HTML file from the web. This clashes with  
the standard Unix head command.


There is a standard workaround, but just renaming the HEAD script  
solves things without (ISTR) breaking too much else.




Re: Odd 'head' problem

2006-06-15 Thread Sherm Pendley

On Jun 15, 2006, at 7:22 AM, Dennis Putnam wrote:

I'm not exactly sure this is what happened but I can't think of  
anything else. After installing several packages from CPAN, my  
daily log maintenance began failing. After some investigation I  
found that '/etc/periodic/daily/500.daily' was getting an error  
from the '/usr/bin/head' command. When I ran 'head' manually the  
command was not the normal one. It appears that one of the perl  
packages replaced the normal 'head' command that works on files,  
with one that works on URLs.


That's precisely what happened. The LWP package installs a script  
called HEAD that does an HTTP HEAD request. On case-insensitive file  
systems like HFS+, head and HEAD are the same.


Has anyone encountered this, or can anyone determine if my surmise  
about one of the perl packages is correct? Thanks.


Yes, many people have had this problem. It's not come up for several  
years, though, because recent versions of the LWP install script asks  
if you want to overwrite head and install HEAD when it detects a case- 
insensitive file system, and the default answer to that question is  
no. Here's what the questions look like:


The lwp-request program will use the name it is invoked with to
determine what HTTP method to use.  I can set up alias for the most
common HTTP methods.  These alias are also installed in
/usr/bin.

Do you want to install the GET alias? [n]
Do you want to install the HEAD alias? [n]
Do you want to install the POST alias? [n]

The moral of the story - *read* the questions, don't just keep  
bouncing on the 'y' and 'return' keys.


sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org



Re: Odd 'head' problem

2006-06-15 Thread Sherm Pendley

On Jun 15, 2006, at 7:43 AM, Dennis Putnam wrote:

Thanks, for letting me know I am not nuts. Unfortunately, I've  
already replaced the wrong one with the right one. I guess I need  
to get the perl version from somewhere so I can rename it.


It's just a symlink to /usr/bin/lwp-request. You don't need it. Just  
use 'lwp-request -m HEAD' instead, if you need to do an HTTP HEAD  
request in a shell script.


sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org



Re: Odd 'head' problem

2006-06-15 Thread Dennis Putnam
I don't recall those questions at all, however it is not at all  
obvious that 'HEAD' is going to replace 'head'. I'm not sure I  
understand the earlier comment about case insensitive filesystems.  
Certainly, OS X is not case insensitive at the CLI level, although  
'Finder' is. However, PERL is running at the CLI level so I don't see  
why that should be a problem.


Oh, well. Lesson learned, albeit too late.

P.S. If 'HEAD' is an alias, where is the real file?

On Jun 15, 2006, at 9:41 AM, Sherm Pendley wrote:


On Jun 15, 2006, at 7:22 AM, Dennis Putnam wrote:

I'm not exactly sure this is what happened but I can't think of  
anything else. After installing several packages from CPAN, my  
daily log maintenance began failing. After some investigation I  
found that '/etc/periodic/daily/500.daily' was getting an error  
from the '/usr/bin/head' command. When I ran 'head' manually the  
command was not the normal one. It appears that one of the perl  
packages replaced the normal 'head' command that works on files,  
with one that works on URLs.


That's precisely what happened. The LWP package installs a script  
called HEAD that does an HTTP HEAD request. On case-insensitive  
file systems like HFS+, head and HEAD are the same.


Has anyone encountered this, or can anyone determine if my surmise  
about one of the perl packages is correct? Thanks.


Yes, many people have had this problem. It's not come up for  
several years, though, because recent versions of the LWP install  
script asks if you want to overwrite head and install HEAD when it  
detects a case-insensitive file system, and the default answer to  
that question is no. Here's what the questions look like:


The lwp-request program will use the name it is invoked with to
determine what HTTP method to use.  I can set up alias for the most
common HTTP methods.  These alias are also installed in
/usr/bin.

Do you want to install the GET alias? [n]
Do you want to install the HEAD alias? [n]
Do you want to install the POST alias? [n]

The moral of the story - *read* the questions, don't just keep  
bouncing on the 'y' and 'return' keys.


sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org





Dennis Putnam
Sr. IT Systems Administrator
AIM Systems, Inc.
11675 Rainwater Dr., Suite 200
Alpharetta, GA  30004
Phone: 678-240-4112
Main Phone: 678-297-0700
FAX: 678-297-2666 or 770-576-1000
The information contained in this e-mail and any attachments is  
strictly confidential. If you are not the intended recipient, any  
use, dissemination, distribution, or duplication of any part of this  
e-mail or any attachment is prohibited. If you are not the intended  
recipient, please notify the sender by return e-mail and delete all  
copies, including the attachments.





Re: Odd 'head' problem

2006-06-15 Thread Sherm Pendley

On Jun 15, 2006, at 7:31 AM, Andy Holyer wrote:


On 15 Jun 2006, at 12:22, Dennis Putnam wrote:

I'm not exactly sure this is what happened but I can't think of  
anything else. After installing several packages from CPAN, my  
daily log maintenance began failing. After some investigation I  
found that '/etc/periodic/daily/500.daily' was getting an error  
from the '/usr/bin/head' command. When I ran 'head' manually the  
command was not the normal one. It appears that one of the perl  
packages replaced the normal 'head' command that works on files,  
with one that works on URLs. Has anyone encountered this, or can  
anyone determine if my surmise about one of the perl packages is  
correct? Thanks.


This is a common gotcha on Os X.


No, it *was* a common gotcha, several years ago.

In the Perl distribution there is a script called HEAD which  
indeed does fetch the header of an HTML file from the web. This  
clashes with the standard Unix head command.


It's in the LWP module, not the core Perl distribution.


There is a standard workaround


Yes, it's called reading the instructions and paying attention. The  
current default behavior for LWP when installing on a case- 
insensitive is to *not* install the HEAD alias for lwp-request.  
That's been the default for quite a long time now - a couple of years  
at least. You have to specifically override the default for this to  
happen.


sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org



Re: Odd 'head' problem

2006-06-15 Thread Dennis Putnam
Thanks for that. I was concerned that perl itself needed it  
(particularly for MCPAN) for some reason. If that is all it is then I  
don't need to worry about it.


On Jun 15, 2006, at 9:49 AM, Sherm Pendley wrote:


On Jun 15, 2006, at 7:43 AM, Dennis Putnam wrote:

Thanks, for letting me know I am not nuts. Unfortunately, I've  
already replaced the wrong one with the right one. I guess I need  
to get the perl version from somewhere so I can rename it.


It's just a symlink to /usr/bin/lwp-request. You don't need it.  
Just use 'lwp-request -m HEAD' instead, if you need to do an HTTP  
HEAD request in a shell script.


sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org





Dennis Putnam
Sr. IT Systems Administrator
AIM Systems, Inc.
11675 Rainwater Dr., Suite 200
Alpharetta, GA  30004
Phone: 678-240-4112
Main Phone: 678-297-0700
FAX: 678-297-2666 or 770-576-1000
The information contained in this e-mail and any attachments is  
strictly confidential. If you are not the intended recipient, any  
use, dissemination, distribution, or duplication of any part of this  
e-mail or any attachment is prohibited. If you are not the intended  
recipient, please notify the sender by return e-mail and delete all  
copies, including the attachments.





Re: Odd 'head' problem

2006-06-15 Thread Sherm Pendley

On Jun 15, 2006, at 9:55 AM, Dennis Putnam wrote:

I don't recall those questions at all, however it is not at all  
obvious that 'HEAD' is going to replace 'head'. I'm not sure I  
understand the earlier comment about case insensitive filesystems.  
Certainly, OS X is not case insensitive at the CLI level, although  
'Finder' is.


That's complete nonsense, as the simplest test will show:

~ sherm$ echo Hello world  head
~ sherm$ cat HEAD
Hello world

HFS+ is a case-insensitive file system. Finder has nothing whatsoever  
to do with it - it's just a user-level file manager.


sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org



Re: Odd 'head' problem

2006-06-15 Thread David Cantrell
On Thu, Jun 15, 2006 at 09:49:54AM -0400, Sherm Pendley wrote:
 On Jun 15, 2006, at 7:43 AM, Dennis Putnam wrote:
 Thanks, for letting me know I am not nuts. Unfortunately, I've  
 already replaced the wrong one with the right one. I guess I need  
 to get the perl version from somewhere so I can rename it.
 It's just a symlink to /usr/bin/lwp-request. You don't need it. Just  
 use 'lwp-request -m HEAD' instead, if you need to do an HTTP HEAD  
 request in a shell script.

Presumably you can create a HEAD alias in your shell and, the shell
being case-sensitive, avoid the problem.

-- 
David Cantrell | A machine for turning tea into grumpiness

IMO, the primary historical significance of Unix is that it marks the
time in computer history where CPUs became so cheap that it was possible
to build an operating system without adult supervision.
 -- Russ Holsclaw in a.f.c