This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Changing HOME for PERL


Please make sure to reply to the list so that others can benefit from
what we discover.  We can take this off list if the moderators decide
this is not the appropriate forum for our discussion.

Dexter_Michael@emc.com wrote:
> Hi Jeremy,
> 
> Thank you - I see I should elabore and include my error for a proper
> solution.
> I am confused as to what I should do next.
> 
> So to reverse what I have done so far I went into cygwin\etc and
> replaced the modified passwd file with the original passwd file.

This is good.  You should be able to leave the /etc/passwd file alone.

> If I remove the HOME variable in Windows, what change do I need to make
> and where to get Cygwin to open at /usr/bin

Your problem doesn't require that your shell drop you into /usr/bin.
While it may work as a hack to solve your issue immediately, you'll
likely run into more issues later on.

> Yesterday I tried to run one of the Perl scripts from class with the
> following SHEBANG:	#!/usr/bin/perl
> 
> In order for me to fix the error (make it go away) I had to change my
> SHEBANG to:
> #!/cygdrive/c/PERL/BIN/perl
> 
> Here is what the error was:
> dextem@USENDEXTEML1C ~/PERL
> $ ./test1-mike.pl
> bash: ./test1-mike.pl: /usr/bin/perl^M: bad interpreter: Permission
> denied

This looks like an issue caused by DOS line endings in your script (see
the ^M in the error message); however, I can't reproduce the error here
even when purposely changing line endings to DOS line endings.

> Using the cygdrive SHEBANG the file runs great:
> dextem@USENDEXTEML1C ~/PERL
> $ ./test1-mike.pl
> he he he
> he he he
> he he he bye

The method you used to change the SheBang line could be the more
important reason for the fix than the change itself, but I would need to
see both versions of the file to be sure.

> So what do I need to do so that I can use the Unix SHEBANG
> #!/usr/bin/perl  
> in the top of all my files.  I prefer not the env variable solution
> unless that is the only way.

Something you can try before sending these files is to run d2u or
dos2unix on the file which is failing:

d2u test1-mike.pl

That will convert all DOS line endings into Unix line endings, and that
may solve your issue.

-Jeremy

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]