Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #173390

Re: My bash script is missing something - what?

From Nicolas George <george@nsup.org>
Newsgroups linux.debian.user
Subject Re: My bash script is missing something - what?
Date 2016-10-10 16:20 +0200
Message-ID <sqJAS-2hV-3@gated-at.bofh.it> (permalink)
References <sqIlx-1ni-27@gated-at.bofh.it> <sqIv8-1FC-37@gated-at.bofh.it> <sqIEO-1J7-13@gated-at.bofh.it> <sqIOu-1Mr-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Le nonidi 19 vendémiaire, an CCXXV, Greg Wooledge a écrit :
> > That just fails differently by responding:
> > 
> > : No such file or directory
> 
> Carriage return.  Did you edit this script with a Microsoft Windows
> program, perhaps?  The shebang line (#!/bin/bash) probably ends with
> a carriage return + line feed, instead of just a line feed.

I had the same diagnosis. Note that modern shells print a more useful
diagnosis:

execve("/tmp/foo.sh", ["/tmp/foo.sh"], [/* 45 vars */]) = -1 ENOENT (No such file or directory)
open("/tmp/foo.sh", O_RDONLY|O_NOCTTY)  = 3
read(3, "#!/bin/sh\r\n", 64)            = 11
close(3)                                = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(2, "zsh:1: /tmp/foo.sh: bad interpreter: /bin/sh^M: no such file or directory\n", 74) = 74
exit_group(127)                         = ?

-- 
  Nicolas George

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

My bash script is missing something - what? Richard Owlett <rowlett@cloud85.net> - 2016-10-10 15:00 +0200
  Re: My bash script is missing something - what? Robert Parker <rlp1938@gmail.com> - 2016-10-10 15:10 +0200
    Re: My bash script is missing something - what? Richard Owlett <rowlett@cloud85.net> - 2016-10-10 15:20 +0200
      Re: My bash script is missing something - what? Robert Parker <rlp1938@gmail.com> - 2016-10-10 15:30 +0200
      Re: My bash script is missing something - what? Greg Wooledge <wooledg@eeg.ccf.org> - 2016-10-10 15:30 +0200
        Re: My bash script is missing something - what? Greg Wooledge <wooledg@eeg.ccf.org> - 2016-10-10 16:20 +0200
        Re: My bash script is missing something - what? Nicolas George <george@nsup.org> - 2016-10-10 16:20 +0200
        PROGRESS - was [Re: My bash script is missing something - what?] Richard Owlett <rowlett@cloud85.net> - 2016-10-10 17:00 +0200
          Re: PROGRESS - was [Re: My bash script is missing something - what?] Nicolas George <george@nsup.org> - 2016-10-10 17:10 +0200
            Re: PROGRESS - was [Re: My bash script is missing something - what?] Richard Owlett <rowlett@cloud85.net> - 2016-10-10 17:50 +0200
              Re: PROGRESS - was [Re: My bash script is missing something - what?] Peter Hillier-Brook <phb@hbsys.plus.com> - 2016-10-10 18:30 +0200
                Re: PROGRESS - was [Re: My bash script is missing something - what?] Greg Wooledge <wooledg@eeg.ccf.org> - 2016-10-10 18:40 +0200
          Re: PROGRESS - was [Re: My bash script is missing something - what?] Greg Wooledge <wooledg@eeg.ccf.org> - 2016-10-10 17:10 +0200
            Re: PROGRESS - was [Re: My bash script is missing something - what?] Richard Owlett <rowlett@cloud85.net> - 2016-10-10 17:50 +0200
      Re: My bash script is missing something - what? Lars Noodén <lars.nooden@gmail.com> - 2016-10-10 15:30 +0200
      Re: My bash script is missing something - what? "Thomas Schmitt" <scdbackup@gmx.net> - 2016-10-10 15:40 +0200
  Re: My bash script is missing something - what? Greg Wooledge <wooledg@eeg.ccf.org> - 2016-10-10 18:00 +0200
  Re: My bash script is missing something - what? songbird <songbird@anthive.com> - 2016-10-10 18:00 +0200

csiph-web