New install, script execution, bad interpreter
I recently re-installed cygwin. The install went well but I have one problem concerning executing scripts. I usually use the perl that comes with cygwin but for some work I need ActiveState modules and I have a script that will call ActiveState as outlined by Mark Parris http://www.cs.unc.edu/~jeffay/dirt/FAQ/cygwin-perl.html This is a bash script (starts with #!/bin/bash) and resides at /usr/local/bin/perl. To call ActiveState I start a script with #!/usr/local/bin/perl rather that #!/usr/local/perl. This has all worked very well untill the re-install. Now when I call active state I get (using the script testAS): bash: ./testAS: /usr/local/bin/perl: bad interpreter: No such file or directory I've check a number of things. The scripts are all unix, dos2unix has no effect. Running a simple bash script works fine, althought ?? if I move the script to my bin directory and back it will not work. cyg testSH bash cyg mv testSH ./bin cyg testSH bash cyg mv ./bin/testSH . cyg testSH bash: /home/jmapoles/bin/testSH: No such file or directory cyg Thanks for any help, John Mapoles __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- 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: New install, script execution, bad interpreter
On Tue, 11 Feb 2003, john mapoles wrote: bash: ./testAS: /usr/local/bin/perl: bad interpreter: No such file or directory Look whether /usr/local/bin/perl exists - I bet it doesn't (because that's what it says: /usr/local/bin/perl: (...) No such file or directory I've check a number of things. The scripts are all unix, dos2unix has no effect. Running a simple bash script works fine, althought ?? if I move the script to my bin directory and back it will not work. cyg testSH bash cyg mv testSH ./bin cyg testSH bash cyg mv ./bin/testSH . cyg testSH bash: /home/jmapoles/bin/testSH: No such file or directory cyg bash.indo, chapter Command Search and Execution says: [...] 3. If the name is neither a shell function nor a builtin, and contains no slashes, Bash searches each element of `$PATH' for a directory containing an executable file by that name. Bash uses a hash table to remember the full pathnames of executable files to avoid multiple `PATH' searches (see the description of `hash' in *Note Bourne Shell Builtins::). A full search of the directories in `$PATH' is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell prints an error message and returns an exit status of 127. [...] What this means is that, when you run your little shell script (without specifying where it is) Bash looks for it in the PATH, and puts it in an internal hash. If you then move your script, the hash will not be up-to-date but it will look in there anyway. If it doesn't exist where it expects tp find it = error This is all you need to know about the hash built-in command: `hash' hash [-'r] [-p FILENAME] [-dt] [NAME] Remember the full pathnames of commands specified as NAME arguments, so they need not be searched for on subsequent invocations. The commands are found by searching through the directories listed in `$PATH'. The `-p' option inhibits the path search, and FILENAME is used as the location of NAME. The `-r' option causes the shell to forget all remembered locations. The `-d' option causes the shell to forget the remembered location of each NAME. If the `-t' option is supplied, the full pathname to which each NAME corresponds is printed. If multiple NAME arguments are supplied with `-t' the NAME is printed before the hashed full pathname. The `-l' option causes output to be displayed in a format that may be reused as input. If no arguments are given, or if only `-l' is supplied, information about remembered commands is printed. The return status is zero unless a NAME is not found or an invalid option is supplied. Hence, when I try your little experiment and type $ hash -l it shows me where I put the script and when I try to launch it, I get the same error as you do. Doing $ hash -r will make it find your original script again. As for your missing /usr/local/bin/perl interpreter: WAG you probably put the perl wrapper script there when you started out, it got lost, so you'll have to put it there again /WAG Good luck! rlc -- 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: New install, script execution, bad interpreter
First you'll want to look at http://cygwin.com/bugs.html. The output of cygcheck as mentioned there (among other things) will likely be quite helpful in understanding your installation. Pay particular attention to your mount points and types (text vs binary). If this doesn't help you determine the problem, send this as directed by http://cygwin.com/bugs.html with your script and where you're running it from to the list. That may be enough context for someone here to see where you're going wrong. Larry Original Message: - From: john mapoles [EMAIL PROTECTED] Date: Tue, 11 Feb 2003 08:41:14 -0800 (PST) To: [EMAIL PROTECTED] Subject: New install, script execution, bad interpreter I recently re-installed cygwin. The install went well but I have one problem concerning executing scripts. I usually use the perl that comes with cygwin but for some work I need ActiveState modules and I have a script that will call ActiveState as outlined by Mark Parris http://www.cs.unc.edu/~jeffay/dirt/FAQ/cygwin-perl.html This is a bash script (starts with #!/bin/bash) and resides at /usr/local/bin/perl. To call ActiveState I start a script with #!/usr/local/bin/perl rather that #!/usr/local/perl. This has all worked very well untill the re-install. Now when I call active state I get (using the script testAS): bash: ./testAS: /usr/local/bin/perl: bad interpreter: No such file or directory I've check a number of things. The scripts are all unix, dos2unix has no effect. Running a simple bash script works fine, althought ?? if I move the script to my bin directory and back it will not work. cyg testSH bash cyg mv testSH ./bin cyg testSH bash cyg mv ./bin/testSH . cyg testSH bash: /home/jmapoles/bin/testSH: No such file or directory cyg Thanks for any help, John Mapoles __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- 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/ mail2web - Check your email from the web at http://mail2web.com/ . -- 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/