public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: Ray Olszewski <ray@comarre.com>
To: linux-newbie@vger.kernel.org
Subject: Re: bash scripting
Date: Sat, 14 Aug 2004 16:13:51 -0700	[thread overview]
Message-ID: <5.1.0.14.1.20040814155510.01f9a050@celine> (raw)
In-Reply-To: <411E779D.6060209@dpomeroy.com>

At 12:35 PM 8/14/2004 -0800, dave wrote:
>OK I installed Mandrake 10 official and all things seem to be normal.  I 
>still get the same message when I try to run a bash script.
>
>#!/bin/env
>bash
>
>
>shopt -s -o nounset
>
>declare LINE
>
>exec 3< /home/dave/scripts/test.dat
>
>while read LINE <&3 ; do
>  printf "%s\n" "$LINE"
>done
>
>exit 0
>
>and here is the error message I get.
>
>[dave@dave scripts]$ ./new.sh
>: bad interpreter: No such file or directory
>[dave@dave scripts]$
>
>Anyone have any ideas.  I used whereis bash and it returned /bin/bash.
>  Everything seems normal and I guess I'm over my head.  Anyone with any 
> suggestions?

You made two changes, not one. You both changed the distro install 
("installed Mandrake 10") -AND- changed the shebang line in the script 
("#!/bin/env"). The second change is definitely wrong.

Go back to the original shebang line ("#!/bin/bash") and see if it works 
now. It does on my system (that is, I get errors, but they involve my not 
having a file named /home/dave/scripts/test.dat).

Or make the first line (probably; check where "env' is on your system) 
"#!/usr/bin/env bash". It too works here (up to the same error).

BTW, if I have the interpreter name wrong, I get a slightly different form 
of error message from you (on a Debian-Sid install). Here, I changed "bash" 
to "nash" and got this:

-bash: ./testscript.sh: /bin/nash: bad interpreter: No such file or directory

Not sure why you're not seeing all that stuff to the left of the ": bad 
interpreter" part. Could just be a difference between your default shell 
and mine (2.05b-19). Or it might indicate something odd about your script 
that is not making it through a representation as e-mail.





-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

  parent reply	other threads:[~2004-08-14 23:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-14 20:35 bash scripting dave
2004-08-14 21:31 ` John Kelly
2004-08-14 23:13 ` Ray Olszewski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-08-15  3:12 dave
2004-08-15  3:00 dave
2004-08-14  6:35 dave
2004-08-14 12:36 ` John Kelly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.1.0.14.1.20040814155510.01f9a050@celine \
    --to=ray@comarre.com \
    --cc=linux-newbie@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox