X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Changing HOME for PERL Date: Thu, 27 Aug 2009 09:04:04 -0400 Message-ID: In-Reply-To: <4A95AA6A.9010909@bopp.net> References: <4A959537 DOT 7020900 AT bopp DOT net> <4A95AA6A DOT 9010909 AT bopp DOT net> From: To: , X-EMM-EM: Active X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Ok passwd is using the original /cygdrive/h now I have removed the HOME user env variable from Windows. When I open Cygwin I am sitting in /cygdrive/h dextem AT USENDEXTEML1C ~ $ pwd /cygdrive/h I have run dos2unix on my file. I can verify this because now when I open the file in UltraEdit I get the message asking if I want to open in in Unix or DOS mode. Also the command od -c test1-mike.pl, shows \n ONLY throughout the file excepts a couple sots near the end of the file. Do I need to worry about those couple spots \n\n doubles appears. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D dextem AT USENDEXTEML1C ~/PERL $ od -c test1-mike.pl 0000000 # ! / u s r / b i n / p e r l \n 0000020 \n $ x =3D 3 ; \n $ c =3D " h 0000040 e " ; \n $ s =3D $ c x $ 0000060 x ; \n $ b =3D " b y e " ; \n p 0000100 r i n t " $ s \ n " ; 0000120 # h e h e h e \n p 0000140 r i n t $ s . " \ n " ; 0000160 # h e h e h e \n \n 0000200 $ a =3D $ s . $ b ; \n p r 0000220 i n t $ a ; 0000240 # h e h e h e b y 0000260 e \n \n 0000263 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Now when I run the file I am getting same error without the ^M dextem AT USENDEXTEML1C ~/PERL $ ./test1-mike.pl bash: ./test1-mike.pl: /usr/bin/perl: bad interpreter: Permission denied Thanks for your help Jeremy.=20 Mike -----Original Message----- From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Jeremy Bopp Sent: Wednesday, August 26, 2009 5:35 PM To: cygwin AT cygwin DOT com Subject: 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 AT emc DOT com wrote: > Hi Jeremy, >=20 > 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. >=20 > 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 >=20 > In order for me to fix the error (make it go away) I had to change my > SHEBANG to: > #!/cygdrive/c/PERL/BIN/perl >=20 > Here is what the error was: > dextem AT 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 AT 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=20=20 > 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 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple