Re: Utility to get IP address of the machine

2006-01-04 Thread Peter J. Acklam
Herb Martin wrote:

 While it is almost always more useful to use Ipconfig
 /all when working interactively, when one just wants the
 IP addresses just using plain ipconfig gets them without
 so much noise to parse through.

Or

   perl -MSocket -MSys::Hostname -wle \
  'print inet_ntoa(scalar gethostbyname(hostname || localhost))'

Peter

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

SV: Bug in printf ?

2005-06-30 Thread Peter J. Acklam
[EMAIL PROTECTED] wrote:

 I'm seeing small bug in printf implementation.

What bug? I didn't see anything unexpected.

Peter

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

Re: Bug in printf ?

2005-06-30 Thread Peter J. Acklam
[EMAIL PROTECTED] wrote:

 ::How come 0.125 gets printed as 0.12, and not 1.3?
 ^^^ 0.13, off cource ;-)

Dealing with integers illustrates the matter more clearly. When
the decimal value is exactly 0.5, then printf should round to the
nearest *even* integer, as far as I know, so you should get

   0   - 0
   0.5 - 0
   1   - 1
   1.5 - 2
   2   - 2
   2.5 - 2
   3   - 3
   3.5 - 4
   4   - 4
   4.5 - 4
   5   - 5

Now I realize that Cygwin's printf doesn't get it right, because

   seq 0 .5 5 | while read x; do printf '%-3s - %.0f\n' $x $x; done

gives

   0   - 0
   0.5 - 1
   1   - 1
   1.5 - 1
   2   - 2
   2.5 - 2
   3   - 3
   3.5 - 3
   4   - 4
   4.5 - 4
   5   - 5

Both Solaris' /bin/printf and Perl's printf() give the right
output.

In your examples there is also an additional issue, which is how
numerical values are represented.  Here is Perl:

   seq .105 .01 .155 | while read x; do printf '%-5s - %.2f\n' $x $x; done

   0.105 - 0.10
   0.115 - 0.12
   0.125 - 0.12
   0.135 - 0.14
   0.145 - 0.14
   0.155 - 0.15

They all seem correct expect the last one.  The reason why 0.155
becomes 0.15 and not 0.16 is that 0.115 can not be represented
exactly.  It is represented as a number which is slightly
*smaller* than 0.155, so it becomes 0.15 after rounding.

Peter

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

SV: SV: Bug in printf ?

2005-06-30 Thread Peter J. Acklam
Dave Korn [EMAIL PROTECTED] wrote:

 [EMAIL PROTECTED] wrote:

  How come 0.125 gets printed as 0.12, and not 1.3?
 
 Absolutely, there's a rounding error of some sort.

For what it's worth: My Sunblade 100 running Solaris 9 has
Solaris' /bin/printf and GNU's printf as /usr/local/bin/printf
and both give 0.12, not 0.13.

I am quite sure it is the printf returning 0.13 that is buggy.
Note that the value 0.125 can be represented exactly with IEEE
double precision arithmetic, so inexact representation is not the
matter here.

Peter

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

SV: SV: Bug in printf ?

2005-06-30 Thread Peter J. Acklam
Dave Korn wrote:

 Have you considered that your sunblade might be operating
 in a different rounding mode, by default?

I didn't know there were different rounding modes.
I thought everyone used so-called unbiased rounding,
so I'm sorry for adding confusion.

 I would imagine that printf may well work under-the-hood
 by shifting the desired decimal places above the point,
 rounding to integer, and printing out that number.

Could be.  I haven't dug into those matters, but your
suggestion certainly makes sense.

Anyway, the following line

   seq -4.5 1 4.5 | while read x; do printf '%4s - %3.0f\n' $x $x; done

which gives

   -4.5 -  -4
   -3.5 -  -3
   -2.5 -  -2
   -1.5 -  -1
   -0.5 -  -1
0.5 -   1
1.5 -   1
2.5 -   2
3.5 -   3
4.5 -   4

suggests that printf rounds towards zero, but something
funny happens for -0.5 and 0.5.

Peter

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

SV: LS and spaces in path names (the xth)

2005-06-28 Thread Peter J. Acklam
I don't see the problem.

 ls -hog CD *
 ls: CD *: No such file or directory

Of course. There is no file whose name is the four character string CD *, so 
ls doesn't find anything.

 ls -hog CD [12]*
 ls: CD [12]*: No such file or directory

Ditto. There is no file whose name is the six character string CD [12]*, so 
ls doesn't find it.

 ls -hog CD*[12]*
 
 WORKS.

What do you mean by WORKS? I get

$ ls -hog CD*[12]*
ls: CD*[12]*: No such file or directory

which is exactly as expected since there I have no file with the is no file 
whose name is the eight character string CD*[12]*.

If you want to list the CD-files with spaces, try

$ ls -hog CD\ *
-rw-r--r--  1 0 Jun 28 15:30 CD 1 - Multimedia.dat
-rw-r--r--  1 0 Jun 28 15:30 CD 2 - Multimedia.dat

$ ls -hog CD *
-rw-r--r--  1 0 Jun 28 15:30 CD 1 - Multimedia.dat
-rw-r--r--  1 0 Jun 28 15:30 CD 2 - Multimedia.dat

Note that the asterisk can not be quoted.

Peter

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

`touch' created wrong file without giving error

2004-06-04 Thread Peter J. Acklam
I tried creating a file named  foo , i.e., with two leading and
two trailing blanks using touch.  It turned out that touch
created the file, but without the two trailing blanks.  It might
be that a file name with trailing blanks can't be created on an
NTFS file system, but touch shouldn't create the wrong file but
rather give an error telling that it failed.  Silently creating
the wrong name is generally bad:

   $ touch '  foo  '
   $ echo $?
   0
   $ for file in *foo*; do echo |$file|; done
   |  foo|
^^

touch returned exit status 0, but failed to create the file.
ls also shows that the file only has the leading blanks:

   $ ls -b *foo*
   \ \ foo

Should touch return an error when it fails?

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: `touch' created wrong file without giving error

2004-06-04 Thread Peter J. Acklam
Corinna Vinschen [EMAIL PROTECTED] wrote:

 On Jun  4 08:41, Peter J. Acklam wrote:

  I tried creating a file named  foo , i.e., with two leading
  and two trailing blanks using touch.  It turned out that
  touch created the file, but without the two trailing blanks.
  It might be that a file name with trailing blanks can't be
  created on an NTFS file system, but touch shouldn't create
  the wrong file but rather give an error telling that it
  failed.  Silently creating the wrong name is generally bad:
 
 That's exactly what Windows does.  Trailing spaces and dots are
 silently ignored.

Ok.  I just expected Cygwin to behave better.  :-/

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: perl cygwin weird thing ..

2004-01-29 Thread Peter J. Acklam
pokley [EMAIL PROTECTED] wrote:

 perl will core dump when parsing file contain
 printf %s,'a' x 0x;

 does anybody got the same problem ?

Looks just fine...

   $ perl -c EOF
printf %s,'a' x 0x;
EOF
   - syntax OK

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: csh color codes

2004-01-29 Thread Peter J. Acklam

 I am running the latest Cygwin on my Win2k and I'm using csh as
 the standard shell. The color mode for XTerm is enabled and
 works fine, e.g.  with ls --color.

 However I have a problem to figure out how to generate the
 appropriate control (escape) sequences to included colors in
 shell script outputs. I have some shell scripts here which
 originate from a HP-UX based csh.  There, the escape sequences
 are generated by pressing Ctrl + V + Esc + [ + 'code',
 where 'code' is e.g. 1m for bold or 32m for green (=
 ^[[32m).  However, these codes don't work within the Cygwin-csh.

 Does anyone know the correct sequences here?

Why not use printf and \033 for the escape character?  The
following prints xxx yyy zzz where yyy is green:

printf 'xxx \033[32myyy\033[m zzz'

Here is a list showing other escape sequences

# foreground colours
printf '\033[30m black \033[m'
printf '\033[31m red \033[m'
printf '\033[32m green \033[m'
printf '\033[33m yellow \033[m'
printf '\033[34m blue \033[m'
printf '\033[35m magenta \033[m'
printf '\033[36m cyan \033[m'
printf '\033[37m white \033[m'

# background colours
printf '\033[40m black \033[m'
printf '\033[41m red \033[m'
printf '\033[42m green \033[m'
printf '\033[43m yellow \033[m'
printf '\033[44m blue \033[m'
printf '\033[45m magenta \033[m'
printf '\033[46m cyan \033[m'
printf '\033[47m white \033[m'

# other
printf '\033[0m default \033[m'
printf '\033[1m bold \033[m'
printf '\033[2m faint \033[m'
printf '\033[3m italic \033[m'
printf '\033[4m underlined \033[m'
printf '\033[5m slowblink \033[m'
printf '\033[6m rapidblink \033[m'
printf '\033[7m negative \033[m'

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: csh color codes

2004-01-29 Thread Peter J. Acklam
 csh does nothing to interpret the sequences; it simply echoes them.

I think the problem was how to *enter* the escape sequences in csh.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: cygwin/regex is non-POSIX

2004-01-20 Thread Peter J. Acklam
[EMAIL PROTECTED] wrote.

 Finally, a common extension appears to be the use or ? after
 a repetition specification to mean non-greedy matching, e.g.
 a+? will match only the first a in .

Just a small historical note:  This extension first appeared in
Perl some 10+ years ago.  It is used after the quantifiers ?, *,
+, and {m,n} to get non-greedy or minimal matching.  The
extension became popular and now implemented in several regex
engines.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: deleting a file ending with a dot

2004-01-16 Thread Peter J. Acklam
Baurjan Ismagulov [EMAIL PROTECTED] wrote:

 tar has created a file ending with a dot, and now I can't delete
 it (I've tried rm, del in cmd, explorer, far, unlink call with
 and without -mno-cygwin). What would you suggest before I search
 an 8-GB volume for the directory entry with a disk editor? I
 would appreciate any help (pointers to NTFS directory structure
 description also welcome).  Scandisk didn't report any problems.

A common way in Unix to delete files with strange names is by
using the inode number:

ls -1ib DIR   # find inode number NUM
find DIR -xdev -inum NUM -exec rm {} \;   # remove the file

but, alas, I don't think that works either.

But I wonder how you created this file in the first place.  It
seems to me that trailing dots are removed.  Here is what I get
when I extract a tar file containing files with trailing dots.
(The tar file was created on Solaris.):

   $ tar xvf bad.tar
   foo/
   foo/bar0
   foo/bar1.
   foo/bar2..
   foo/bar3...
   foo/bar4
   foo/bar5.

   $ ls -1 foo
   bar0
   bar1
   bar2
   bar3
   bar4
   bar5

The dots are gone.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: deleting a file ending with a dot

2004-01-16 Thread Peter J. Acklam
Baurjan Ismagulov [EMAIL PROTECTED] wrote:

 Peter J. Acklam wrote:
 
  ls -1ib DIR # find inode number NUM

 ls: cachedmetrics.: No such file or directory

Huh.  ls seems to  notice that the directory contains a
file named something like cachedmetrics., but yet it
is able to find it.

A wild guess is that readdir() finds it, and tells ls that
the file exists, but when ls does a stat() on the file, it
fails and that's why you get the error.

What is the output if you run the following script with the
directory as the input argument.  It is essentially the
same as ls -b but no stat() is done.

--
#!/usr/bin/env perl

use strict;
use warnings;

my $dir = shift;

opendir DIR, $dir or die $dir: can't open directory: $!\n;
for (readdir DIR) {
#s/([^\040-\176\240-\377])/sprintf '\%03o', ord $1/eg;
s/([^\040-\176])/sprintf '\%03o', ord $1/eg;
print $_, \n;
}
closedir DIR or die $dir: can't open directory: $!\n;
--

  But I wonder how you created this file in the first place.
  It seems to me that trailing dots are removed.

 Wow! What are the versions of Windows, cygwin and tar?
 I use 2000, 1.3.22, 1.13.25.

Windows XP, Cygwin 1.5.5, tar 1.13.25.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Perl CPAN module help

2003-11-19 Thread Peter J. Acklam
Yitzchak Scott-Thoennes [EMAIL PROTECTED] wrote:

 Maybe my memory is going, but I thought the reason you suggested
 he switch to /usr/local was so that he wouldn't have the
 HEAD/head.exe conflict and it would go ahead and successfully
 install /usr/local/bin/HEAD.

Well, yes, but many people, including me, have /usr/local/bin
before /usr/bin in their PATH, so when calling head, it's the
/usr/local/bin/HEAD that is chosen.  I should have mentioned this
specifically since it's not an issue if you have /usr/bin before
/usr/local/bin in your path.

Is there a way to make path searches case insensitive?

On the other hand, if you have /usr/bin before /usr/local/bin
you'll not get the latest versions when Perl scripts, like cpan,
are updated.

 Rather than specify PREFIX for every module build and set a
 PERL5LIB, you might just build your own perl with the
 -Uusrbinperl configure option, so it defaults to /usr/local/.
 (There are just a few non-core modules included in the cygwin
 distribution that you would probably want to start by building:
 Archive::Tar, Compress::Zlib, Term::ReadKey, MD5, Net::Telnet,
 Term::ReadLine::Perl.)

True, but I'm not sure whether someone who has problems installing
CPAN modules is yet capable of building a new version of Perl.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Perl CPAN module help

2003-11-18 Thread Peter J. Acklam
Gary Nielson [EMAIL PROTECTED] wrote:

 Thank you so much. If I wanted to start fresh with a new perl
 installation -- replacing the executables and all the modules --
 how do you recommend I do this under cygwin.

  - Run setup.exe and uninstall all versions of perl.

  - Manually remove the perl library directory

   rm -rf /usr/lib/perl5

  - Run setup.exe and install perl.

  - Start the CPAN shell.

   cpan

  - You'll be prompted for a lot of information.  I accept the
default everywhere, with the following exceptions:

  - CPAN build and cache directory? [...]  /.cpan
 ^^
  - What is your favorite shell? /usr/bin/bash
   ^
  - Every Makefile.PL is run by perl in a separate process. Likewise we
...
Your choice:  [] PREFIX=/usr/local
  ^
  - Now we need to know where your favorite CPAN sites are located. Push
a few sites onto the array (just in case the first on the array won't
...
(1) Africa
(2) Asia
(3) Central America
(4) Europe
(5) North America
(6) Oceania
(7) South America

Here you must make a choice depending on your location.
Since I'm in Norway, I chose continent 4 (Europe),
contries 20 and 28 (Norway and Sweden) and then all the
sites that were listed.

   - Now you should see something like

   cpan shell -- CPAN exploration and modules installation (v1.7601)
   ReadLine support enabled

   cpan 

   - Remember to set the PERL5LIB environment variable with one of
 these (depending on whether you're using a C-shell or a
 Bourne shell):

   setenv PERL5LIB /usr/local/lib/perl5:/usr/local/lib/perl5/site_perl

   PERL5LIB=/usr/local/lib/perl5:/usr/local/lib/perl5/site_perl
   export PERL5LIB

   - If you install the LWP module (or better yet Bundle::LWP),
 don't install the HEAD alias, since you'll end up with a name
 conflict with the standard head utility.

*Whew*  That should be all, I think.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Plus sign '+' in file permissions

2003-11-18 Thread Peter J. Acklam
Derek Mahar [EMAIL PROTECTED] wrote:

 To what does the plus sign '+' refer at the end of the list of
 file permissions in a Cygwin directory listing (for example,
 -rw-rw-rw-+)?  I'm unfamiliar with this permission since I've
 never seen it in either Solaris or Linux directory listings.
 Using bash or Windows Explorer, how do I enable or disable this
 file permission?

The + indicates that there is an ACL (Access Control List) entry
associated with the file.  I don't know about Linux, but ACLs are
used on Solaris too.  See the manual pages for getfacl and
setfacl.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Perl CPAN module help

2003-11-17 Thread Peter J. Acklam
Gary Nielson [EMAIL PROTECTED] wrote:

 Thank you for your help. I understand what you are saying
 here. I will try installing under /usr/local.

I forgot to mention that Perl will not, by default, search for
modules in /usr/local.  This is a disadvantage, but it's worth it,
in my opinion.  The simplest way to make Perl look for modules
there is to add

   PERL5LIB=/usr/local/lib/perl5:/usr/local/lib/perl5/site_perl

to your personal startup file (~/.bash_profile or whatever).

 My question, though, is what do I do about all the modules I've
 installed under /usr?  How do I deal with them?  Do I need to
 re-install them under /usr/local? Do I then need to somehow
 remove them from /usr? Or can I have modules under both
 directories, leaving the ones that work under /usr and place new
 ones under /usr/local?

If they're working properly, you might as well leave them alone.
If they're broken, re-install them with PREFIX=/usr/local.

Note that perl will search the directories specified in PERL5LIB
before the other directories, so if you have a working module
under /usr/local and a broken one under /usr, then the working one
under /usr/local will be used.  The default search path:

$ unset PERL5LIB
$ perl -wle 'print for @INC'
/usr/lib/perl5/5.8.0/cygwin-multi-64int
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
.

Now, note how /usr/local/... comes first:

$ export PERL5LIB=/usr/local/lib/perl5:/usr/local/lib/perl5/site_perl
$ perl -wle 'print for @INC'
/usr/local/lib/perl5/5.8.0/cygwin-multi-64int
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/5.8.0/cygwin-multi-64int
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
/usr/lib/perl5/5.8.0/cygwin-multi-64int
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
.

You may try to remove modules under /usr, but be careful so you
don't remove things you need.  If you really want to remove them,
I'd rather do that by uninstalling Perl, removing everything under
/usr/lib/perl5 and start over with a clean Perl installation.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Perl CPAN module help

2003-11-16 Thread Peter J. Acklam
Gary Nielson [EMAIL PROTECTED] wrote:

 I am getting somewhere. I used setup and installed needed
 executables such as gcc. Did a force install in cpan for LWP
 modules and it seemed to be go great. All tests were successful
 in make test. But when running make install I got the error:

You shouldn't use force install unless you really know what
you're doing.  If your module fails a regular install you should
investigate the problem and find the solution rather than do a
force install.  With a force install you are likely to install
modules which fail some way on your system and hence shouldn't
have been installed.

 Cannot forceunlink /usr/bin/HEAD: No such file or directory at
 /usr/lib/perl5/5.8.0/File/Find.pm line 873.
 make: *** [pure_site_install] Error 255
 /usr/bin/make install -- NOT OK.

 The Find.pm line in question is: { $wanted_callback-() }; #
 protect against wild next

When installing LWP you are asked whether you want to install the
GET, HEAD, and POST programs.  You have chosed yes or the force
install did it for you.  Either way, it was discovered that HEAD
exists (as /usr/bin/head.exe) and Perl is trying to remove it, but
although which head says /usr/bin/HEAD, there really is no
/usr/bin/HEAD.exe, it's /usr/bin/head.exe.  The problem is
that which matches case insensitively, but rm doesn't.

The solution is:  Don't install CPAN modules under /usr, use
/usr/local!  When you install modules without CPAN, use the
steps

perl Makefile.PL PREFIX=/usr/local
make
make test
make install

this is done with the CPAN shell by setting

cpan o conf makepl_arg PREFIX=/usr/local
cpan o conf commit

 Any idea what is going wrong, or is the question better posed to
 a perl forum?

The head vs HEAD is a Cygwin thing, so I think it belongs
equally well here.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Perl CPAN module help

2003-11-14 Thread Peter J. Acklam
Doug VanLeuven [EMAIL PROTECTED] wrote:

#!/usr/bin/perl

use CPAN;
# list all modules on my disk and note the newer versions
for $mod (CPAN::Shell-expand(Module,/./)){
 next unless $mod-inst_file;
 # here only when installed
 if ($mod-inst_version eq undef) {
 printf %s :No VERSION\n, $mod-id;
 }
 elsif ($mod-uptodate){
 printf %s %s\n, $mod-id, $mod-inst_version
 }
 else {
 # here when not up to date
 printf %s %s, NEW VERSION=%s\n,
 $mod-id, $mod-inst_version, $mod-cpan_version;
 }

That will miss all modules that don't exist on CPAN.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Perl CPAN module help

2003-11-14 Thread Peter J. Acklam
Patrick Eisenacher [EMAIL PROTECTED] wrote:

man CPAN has this to offer:

# list all modules on my disk that have newer versions on CPAN
for $mod (CPAN::Shell-expand(Module,/./)){
   next unless $mod-inst_file;
   next if $mod-uptodate;
   printf Module %s is installed as %s, could be updated to %s from C
PAN\n, $mod-id, $mod-inst_version, $mod-cpan_version;
}

which gives you a list of all installed modules, including the
distribution ones.

No, no!  It only lists modules for which there exists a newer
version on CPAN.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Perl CPAN module help

2003-11-13 Thread Peter J. Acklam
Gary Nielson [EMAIL PROTECTED] wrote:

I tried installing several perl modules today, but make test
failed on several in the LWP package and for HTML::Parser
etc. Couldn't find modules I'd already installed in the INC
path.

That's strange.  Which module is not found?  Since you have
installed it, where is it?  What is your @INC?  You can see your
@INC with

   perl -wle 'print for @INC'

With HTML::Parser it couldn't run gcc because it was not found.

Then you must install it.  :-)  Run setup.exe and install gcc.

How do you use CPAN under cygwin?

   perldoc cpan

To fire up the cpan shell, just type, at the cygwin shell

   cpan

Is there a web page that outlines how to configure CPAN for
cygwin, is that what is needed?

I found it to be quite straight forward.  Please be specific and
tell where you run into problems.

Are others having problems and how did you fix them.

We'll take one thing at a time.  I've used the cpan shell a lot,
but I need some more information about where you run into
problems.

I successfully install some and have force installed others and
notice that if you do a perldoc perllocal you only get the first
three modules listed, whereas if you do a more on the perllocal
file, you see a lot more listed. What's up with that, can anyonw
explain?

I have never used perldoc perllocal to see what modules I have
installed, so at this point I can't tell you what is wrong.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Cannot read: No space left on device accessing DDS3 drive on W2K

2003-11-13 Thread Peter J. Acklam
Sean Brown [EMAIL PROTECTED] wrote:

Problem Description:  I have a tape archive on a DDS3 tape
created under GNU/Linux 2.2.18.  The tape was created with a
blocksize of 512 and IS accessible and usable on the linux
machine.  On the W2K machine using Cygwin, I get the following
error when trying to list the contents of the tape:

$ tar tvf /dev/st0
tar: /dev/st0: Cannot read: No space left on device
tar: At beginning of tape, quitting now
tar: Error is not recoverable: exiting now

This is just a guess, but:  Does the reading tape drive support
the density you used when the tape was written?  I remember seeing
strange error messages when I had written a tape with density 35
and tried to read it with an older tape drive which only supported
densities up to 20.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: tail

2003-11-13 Thread Peter J. Acklam
Paul-Kenji Cahier [EMAIL PROTECTED] wrote:

I'm experiencing trouble with tail

i want to do a tail +2 but it wont be recognized
tail --version wont give any output either

any idea?

The first thing to do when a command behaves differently
than expected is to see what it is, so try which tail.
Is it /usr/bin/tail?

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: how to do hexdump to analyze special white-space characters?

2003-11-11 Thread Peter J. Acklam
ahnkle [EMAIL PROTECTED] wrote:

 I discovered a program called dump that displays input
 as hex. I found it very useful. It is in the cygutils
 package.

There is also od.  To see \r, \n etc., try

   od -c FILE

For a hex dump try

   od -x FILE

There are many other options too.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Is there a 'ping' in Cygwin?

2003-10-17 Thread Peter J. Acklam
Hughes, Bill [EMAIL PROTECTED] wrote:

 Apologies if this is as dumb as it seems to me,
 but is 'ping' available in Cygwin from the prompt?

If you have installed inetutils, yes.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Is there a 'ping' in Cygwin?

2003-10-17 Thread Peter J. Acklam
Corinna Vinschen [EMAIL PROTECTED] wrote:

 Peter J. Acklam wrote:
 
  Hughes, Bill [EMAIL PROTECTED] wrote:
 
   Apologies if this is as dumb as it seems to me,
   but is 'ping' available in Cygwin from the prompt?
 
  If you have installed inetutils, yes.

 Ping isn't part of inetutils.  The right answer is,
 you have ping if you're running the Windows subsystem
 on your Cygwin machine.

Thanks for the correction. I realized a bit too late
that I was wrong.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Perl, the GMP library, and the Math::BigInt::GMP module

2003-10-09 Thread Peter J. Acklam
Gerrit @ cygwin [EMAIL PROTECTED] wrote:

 This ia a problem with MakeMaker.  It just looks for .a
 libraries and doesn't see the .dll.a import library, I thought
 it was fixed, which version of perl are you using?

I am using Perl 5.8.0-5, with MakeMaker version 6.17.

 As a workaround try creating a symlink libgmp.dll.a libgmp.a or
 create an empty libgmp.a in /usr/lib.

I made the symlink

   /usr/lib/libgmp.a - /usr/lib/libgmp.dll.a

and it now builds, but with many errors:

   Writing Makefile for Math::BigInt::GMP
   cp lib/Math/BigInt/GMP.pm blib/lib/Math/BigInt/GMP.pm
   /usr/bin/perl.exe /usr/lib/perl5/5.8.0/ExtUtils/xsubpp  -typemap 
/usr/lib/perl5/5.8.0/ExtUtils/typemap -typemap typemap
GMP.xs  GMP.xsc  mv GMP.xsc GMP.c
   gcc -c   -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -DUSEIMPORTLIB -O3   
-DVERSION=\1.11\ -DXS_VERSION=\1.11\  -I/
   usr/lib/perl5/5.8.0/cygwin-multi-64int/CORE   GMP.c
   GMP.c: In function `XS_Math__BigInt__GMP_destroy':
   GMP.c:146: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP___stringify':
   GMP.c:176: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__str':
   GMP.c:219: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__as_hex':
   [...]
   GMP.c:1223: warning: cast to pointer from integer of different size
   GMP.c:1230: warning: cast to pointer from integer of different size
   Running Mkbootstrap for Math::BigInt::GMP ()
   chmod 644 GMP.bs
   rm -f blib/arch/auto/Math/BigInt/GMP/GMP.dll
   LD_RUN_PATH= ld2  -s -L/usr/local/lib GMP.o  -o 
blib/arch/auto/Math/BigInt/GMP/GMP.dll  /usr/lib/perl5/5.8.0/cygwin-mu
   lti-64int/CORE/libperl.dll.a -lgmp
   gcc -shared -o  GMP.dll -Wl,--out-implib=libGMP.dll.a 
-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--stack,8388
   608 \
   -s -L/usr/local/lib GMP.o  
/usr/lib/perl5/5.8.0/cygwin-multi-64int/CORE/libperl.dll.a -lgmp
   Creating library file: libGMP.dll.a
   mv GMP.dll libGMP.dll.a blib/arch/auto/Math/BigInt/GMP/
   chmod 755 blib/arch/auto/Math/BigInt/GMP/GMP.dll
   cp GMP.bs blib/arch/auto/Math/BigInt/GMP/GMP.bs
   chmod 644 blib/arch/auto/Math/BigInt/GMP/GMP.bs
 /usr/bin/make  -- OK

The make test step fails with zillion errors:

   Running make test
   /usr/bin/perl.exe -MExtUtils::Command::MM -e test_harness(0, 
'blib/lib', 'blib/arch') t/*.t
   t/bigfltpm# Test 1 got: 'Math::BigInt::Calc' (t/bigfltpm.inc at line 3)
   #   Expected: 'Math::BigInt::GMP'
   t/bigfltpmFAILED test 1
   Failed 1/1627 tests, 99.94% okay
   t/bigintg.Can't load '../blib/arch/auto/Math/BigInt/GMP/GMP.dll' for 
module Math::BigInt::GMP: dlopen: Win32 error 9
   98 at /usr/lib/perl5/5.8.0/cygwin-multi-64int/DynaLoader.pm line 229.
at t/bigintg.t line 18
   Compilation failed in require at t/bigintg.t line 18.
   BEGIN failed--compilation aborted at t/bigintg.t line 18.
   t/bigintg.dubious
   Test returned status 255 (wstat 65280, 0xff00)
   DIED. FAILED tests 1-117
   Failed 117/117 tests, 0.00% okay
   t/bigintpmok 1/2365# Test 2 got: UNDEF (bigintpm.inc at line 193)
   #   Expected: '1234-345'
   # Test 3 got: UNDEF (bigintpm.inc at line 193 fail #2)
   t/bigintpmNOK 3#   Expected: '3'
   [...]

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Perl, the GMP library, and the Math::BigInt::GMP module

2003-10-07 Thread Peter J. Acklam
I have installed the latest versions of Perl and the GMP library,
and want to install the Math::BigInt::GMP Perl module which makes
use of this GMP library, but I can't make them play together.

There is a complaint No library found for -lgmp, but I know the
library is installed.  I can also see the files:

   $ find /usr/lib /usr/local/lib -type f | grep -i gmp
   /usr/lib/libgmp.dll.a
   /usr/lib/libgmp.la
   /usr/lib/w32api/libigmpagnt.a

Below are the results from my attempt.  What am I doing wrong?
What must I do to get it working?

   cpan install Math::BigInt::GMP
   Running install for module Math::BigInt::GMP
   Running make for T/TE/TELS/math/Math-BigInt-GMP-1.11.tar.gz
   Checksum for /.cpan/sources/authors/id/T/TE/TELS/math/Math-BigInt-GMP-1.11.tar.gz ok
   Math-BigInt-GMP-1.11/
   Math-BigInt-GMP-1.11/t/
   Math-BigInt-GMP-1.11/t/bigintg.t
   Math-BigInt-GMP-1.11/t/bigintpm.t
   Math-BigInt-GMP-1.11/t/bigintpm.inc
   Math-BigInt-GMP-1.11/t/bigfltpm.t
   Math-BigInt-GMP-1.11/t/bigfltpm.inc
   Math-BigInt-GMP-1.11/lib/
   Math-BigInt-GMP-1.11/lib/Math/
   Math-BigInt-GMP-1.11/lib/Math/BigInt/
   Math-BigInt-GMP-1.11/lib/Math/BigInt/GMP.pm
   Math-BigInt-GMP-1.11/BUGS
   Math-BigInt-GMP-1.11/TODO
   Math-BigInt-GMP-1.11/GMP.xs
   Math-BigInt-GMP-1.11/SIGNATURE
   Math-BigInt-GMP-1.11/LICENSE
   Math-BigInt-GMP-1.11/README
   Math-BigInt-GMP-1.11/Makefile.PL
   Math-BigInt-GMP-1.11/typemap
   Math-BigInt-GMP-1.11/INSTALL
   Math-BigInt-GMP-1.11/CHANGES
   Math-BigInt-GMP-1.11/CREDITS
   Math-BigInt-GMP-1.11/MANIFEST
   Removing previously used /.cpan/build/Math-BigInt-GMP-1.11

 CPAN.pm: Going to build T/TE/TELS/math/Math-BigInt-GMP-1.11.tar.gz

   Checking if your kit is complete...
   Looks good
   Note (probably harmless): No library found for -lgmp
   Writing Makefile for Math::BigInt::GMP
   cp lib/Math/BigInt/GMP.pm blib/lib/Math/BigInt/GMP.pm
   /usr/bin/perl.exe /usr/lib/perl5/5.8.0/ExtUtils/xsubpp  -typemap 
/usr/lib/perl5/5.8.0/ExtUtils/typemap -typemap typemap  GMP.xs  GMP.xsc  mv GMP.xsc 
GMP.c
   gcc -c   -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -DUSEIMPORTLIB -O3   
-DVERSION=\1.11\ -DXS_VERSION=\1.11\  -I/usr/lib/perl5/5.8.0/
   cygwin-multi-64int/CORE   GMP.c
   GMP.c: In function `XS_Math__BigInt__GMP_destroy':
   GMP.c:146: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP___stringify':
   GMP.c:176: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__str':
   GMP.c:219: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__as_hex':
   GMP.c:262: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__as_bin':
   GMP.c:302: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__modpow':
   GMP.c:339: warning: cast to pointer from integer of different size
   GMP.c:346: warning: cast to pointer from integer of different size
   GMP.c:353: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP_mmod_gmp':
   GMP.c:381: warning: cast to pointer from integer of different size
   GMP.c:388: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__add':
   GMP.c:417: warning: cast to pointer from integer of different size
   GMP.c:424: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__inc':
   GMP.c:453: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__dec':
   GMP.c:481: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP_sub_two':
   GMP.c:509: warning: cast to pointer from integer of different size
   GMP.c:516: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__rsft':
   GMP.c:552: warning: cast to pointer from integer of different size
   GMP.c:559: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__lsft':
   GMP.c:605: warning: cast to pointer from integer of different size
   GMP.c:612: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__mul':
   GMP.c:651: warning: cast to pointer from integer of different size
   GMP.c:658: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP_div_two':
   GMP.c:687: warning: cast to pointer from integer of different size
   GMP.c:694: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP_bdiv_two':
   GMP.c:726: warning: cast to pointer from integer of different size
   GMP.c:733: warning: cast to pointer from integer of different size
   GMP.c: In function `XS_Math__BigInt__GMP__mod':
   GMP.c:766: warning: cast to pointer from 

RE: cp /dev/zero filename creates large files

2003-09-25 Thread Peter J. Acklam
Don Sharp [EMAIL PROTECTED] wrote:

I carried out the following sequence of commands

$ for i in `cat /tmp/d`; do if [ -f $i.idx ]; then ls -l ${i}*; fi; done
-rw-r--r--1 don  None0 Jun 17  1998 dtaq
-rw-r--r--1 don  None 3072 Jun 17  1998 dtaq.idx
$ cp /dev/zero dtaq.idx

The cp appeared to be hanging and the disc was rattling away, so in
another window I typed in

$ ls -l dtaq*
-rw-r--r--1 don  None0 Jun 17  1998 dtaq
-rw-r--r--1 don  None 65307648 Jun 17  1998 dtaq.idx

and you can see that the reported size of the target of the 'cp
/dev/zero' has grown to a considerable size in a short time.

Can anyone else reproduce this?

Hopefull, everyone can reproduce this.  I think you are mixing
/dev/zero with /dev/null.  /dev/zero will always return a buffer
full of zeros (that is NULs, not the digit or letter zero).
/dev/zero has infinite length, so copying from it with cp to
a regular file will always cause you do run out of disk space.

Peter

-- 
Peter J. Acklam - [EMAIL PROTECTED] - http://home.online.no/~pjacklam


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



/usr/bin/tar: Archive value 88578 is out of uid_t range 0..65535

2003-02-01 Thread Peter J. Acklam
I use the cpan shell to install Perl modules, but I often get the
error messages like

   /usr/bin/tar: Archive value 88578 is out of uid_t range 0..65535

and tar ends with a non-zero exit status so the module won't
install.  How can I get around this?  Are there any plans of
supporting higher uids than 65535 in Cygwin?

Peter

-- 
I wish dialog boxes had a butten saying Whatever.  I hate being
forced to answer Yes or No to a question I have no opinion on
whatsoever.  There ought to be a button matching my indifference.


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Re: perl -i is very dangerous !

2002-05-06 Thread Peter J. Acklam

Gerrit P. Haase [EMAIL PROTECTED] wrote:

 Marc schrieb:
 
  mc@MILLENIUM:~/test/perldestroy# cat test.txt
  this is
  a test
  for cygwin
  mc@MILLENIUM:~/test/perldestroy# perl -i -ne 's/this/works/' test.txt
  Can't do inplace edit on test.txt: Permission denied.
  mc@MILLENIUM:~/test/perldestroy# ls
  any idea ?
 
 It is gone.
 
 Use perl -i.bak instead.

Not to mention to use -p and *not* -n.  The -n option will not
write back to the file, so it will end up having size zero.

Peter

-- 
Where do bit streams end?  In bit rivers?


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Re: /usr/bin/env - Incorrect parsing of #! line?

2002-02-21 Thread Peter J. Acklam

Christopher Faylor [EMAIL PROTECTED] wrote:

 Peter J. Acklam wrote:

  Since the behaviour is different when the line is in the
  shebang line, it has to be documented somewhere.

 AFAIK, it isn't documented anywhere except in the code.  I don't
 know where it would be documented, actually.  This obviously
 isn't an issue with /usr/bin/env.

Ok.  I'm not sure either.  I know that Solaris has an intro(1)
manual page which describes general command behaviour, standard
option parsing, etc.  I guess that might be a suitable place, but
cygwin has no such manual page.

 Where did you read about the behavior in all UNIXes I work on?
 We should probably document it in a similar place for cygwin.

That turned out to be an incorrect assumption on my part.  I have
worked with many UNIX flavours, and assumed that I had been using
this syntax on all of them, but it turned out to be that I had
only used it on Solaris where this syntax actually works.

 We'd certainly appreciate a patch to our documentation.  Just
 send it to [EMAIL PROTECTED] for review.

I'm not sure where it really ought to be documented.  :-/

Peter

-- 
People say I'm indifferent, but I don't care.


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Re: /usr/bin/env - Incorrect parsing of #! line?

2002-02-20 Thread Peter J. Acklam

Christopher Faylor [EMAIL PROTECTED] wrote:

 If it works the same way on linux and on cygwin, then there is
 nothing to fix.

Ok.  But where is this documented?

I expected #!/usr/bin/env perl -w to work because I thought the
line would be interpreted as on the command line (shell) and as is
documented in the manual page for env.  Since the behaviour is
different when the line is in the shebang line, it has to be
documented somewhere.

Peter

-- 
People say I'm indifferent, but I don't care.


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




/usr/bin/env - Incorrect parsing of #! line?

2002-02-12 Thread Peter J. Acklam

I use different computers where Perl is installed different
places, so I can't hardcode the location of perl in the shebang
line.  Thus, I use env, which works great on all UNIXes I work on,
for instance

#!/usr/bin/env perl -w

print This is Perl version $]\n;

but on Cygwin I get

/usr/bin/env: perl -w: No such file or directory

why does Cygwin look for the file perl -w.  No UNIX I have
worked on would parse the shebang line that way.

Peter

-- 
People say I'm indifferent, but I don't care.


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Re: /usr/bin/env - Incorrect parsing of #! line?

2002-02-12 Thread Peter J. Acklam

Christopher Faylor [EMAIL PROTECTED] wrote:

 Peter J. Acklam wrote:

  [...]
  why does Cygwin look for the file perl -w.  No UNIX I
  have worked on would parse the shebang line that way.
 
 Because...  we're mean.

I'm new here so I don't know who you are, but I hope one can
expect more informative responses than this gibberish.

Peter

-- 
People say I'm indifferent, but I don't care.


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Re: /usr/bin/env - Incorrect parsing of #! line?

2002-02-12 Thread Peter J. Acklam

David Gluss [EMAIL PROTECTED] wrote:

 I don't know if it's constructive to suggest an alternative trick, rather
 than trying to fix cygwin, in this forum.  However, this might work
 for you:

: # -*-Mode: perl;-*- use perl, wherever it is
eval 'exec perl -wS $0 ${1+$@}'
  if 0;
#!/usr/local/bin/perl -w


Thanks!  But I wonder, does the colon really belong there?  If so,
what does it do?  Will this work under all common shells (sh, ksh,
bash, zsh, csh, tcsh)?

I hasitate to use a script with no shebang line, because I'm so
used to it always being present in a script, but if I don't really
need it, then I guess I can do without.

Peter

-- 
People say I'm indifferent, but I don't care.


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/