[GRASS5] g.html2man: perl location problem

Justin Hickey jhickey at hpcc.nectec.or.th
Thu Mar 1 23:12:55 EST 2001


Hi Markus

Markus Neteler wrote:
> > Yes, perl has a similar method. The following is from the 
> > "Programming Perl" book:
> >
> > #!/bin/sh -- #perl, to stop looping
> > eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
> >     if 0;
> >
> > .. rest of perl script ...
> >
> > It's strange but it seems to work for me. In this case you simply
> > substitute maybe $GRASS_PERL for /usr/bin/perl.
> 
> Looks funny! However, the "--" is not supported here:
> 
> g.html2man
> sh: -- #perl, to stop looping: unrecognized option
> Usage:  sh [GNU long option] [option] ...
>         sh [GNU long option] [option] script-file ...

This is strange. -- is definitely a valid option for sh on Linux. You
can try it on the command line. In fact, I could not use *any* option
after #! /bin/sh, strange. So, I checked the perl newsgroup archive and
there was a post similar to this and the reply was that it was probably
a bug in the GNU sh. However, I found a workaround. Simply call
g.html2man with sh. That is:

sh g.html2man.

This should work, at least my test cases worked here on both Linux and
SGI.

> And also not the -S:
>
> export GRASS_PERL=/usr/bin/perl
> g.html2man
> /bin/sh: -S: unrecognized option
> Shall I simply remove these flags?

The -S option is an option to perl, not sh, so please do not remove it.

-- 
Sincerely,

Jazzman (a.k.a. Justin Hickey)  e-mail: jhickey at hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do.  ---Anonymous

Jazz and Trek Rule!!!
==================================================================

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list