delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/06/04/20:44:39

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 4 Jun 2002 19:44:30 -0500
From: David T-G <davidtg-cygwin AT justpickone DOT org>
To: "CygWin Users' List" <cygwin AT cygwin DOT com>
Cc: Andrew Markebo <flognat AT flognat DOT myip DOT org>
Subject: Re: associating(?) .sh scripts
Message-ID: <20020605004430.GP1231@justpickone.org>
References: <20020603132629 DOT GG1231 AT justpickone DOT org> <m3adqcpiab DOT fsf AT flognat DOT myip DOT org>
Mime-Version: 1.0
In-Reply-To: <m3adqcpiab.fsf@flognat.myip.org>
User-Agent: Mutt/1.3.99i

--OwXh6gFRjCd3qPCM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi, all --

Sorry I couldn't get to this yesterday...  Anyone remember where we were?  =
:-)

=2E..and then Andrew Markebo said...
%=20
% / David T-G <davidtg-cygwin AT justpickone DOT org> wrote:
% |=20
% | I have a shell script "meta-play.sh" which I run to collect metadata
% | after I burn an MP3 CD.  I cd into the source directory and run
% |=20
% |   ../meta-play.sh cdname
%=20
% >From where? The bash script?? command/cmd??=20

=46rom a bash prompt which was fired off directly from a Start menu shortcut
that calls bash.exe.


%=20
% What does the first lines of meta-play.sh look like, what about
% dos/unix newlines..=20

When I ran file on it this evening I was surprised to find that it had
CR/LF endings and so I fixed that, but that didn't cut it.

  BASH-2.05a$ ./meta-play.sh
  BASH: ./meta-play.sh: No such file or directory
  BASH-2.05a$ !fil
  file ./meta-play.sh
  ./meta-play.sh: ASCII text
  BASH-2.05a$ head -5 !$
  head ./meta-play.sh

  [ -z "$1" ] && { echo "" ; echo "Whoa; gimma a disc ID like calix-01" ; e=
cho "" ; exit 1 ; }
  n=3D"$1"

  echo ""
  BASH-2.05a$ df -k .
  Filesystem           1k-blocks      Used Available Use% Mounted on
  e:                     2096832    128832   1968000   7% /e
  BASH-2.05a$ mount
  c:\utils\cygwin\bin on /usr/bin type system (binmode)
  c:\utils\cygwin\lib on /usr/lib type system (binmode)
  c:\utils\cygwin on / type system (binmode)
  c: on /c type user (binmode,noumount)
  d: on /d type user (binmode,noumount)
  e: on /e type user (binmode,noumount)


%=20
% What does it say if you do 'file meta-play.sh', ls -l of it?

Oh, right.

  BASH-2.05a$ ls -l ./meta-play.sh
  -rw-r--r--    1 david    unknown       907 Jun  4 19:30 ./meta-play.sh

So I tried adding a /bin/sh at the top but that didn't work:

  BASH-2.05a$ head -2 !$
  head -2 ./meta-play.sh
  #!/bin/sh
  [ -z "$1" ] && { echo "" ; echo "Whoa; gimma a disc ID like calix-01" ; e=
cho "" ; exit 1 ; }
  BASH-2.05a$ !$
  ./meta-play.sh
  BASH: ./meta-play.sh: /bin/sh: bad interpreter: No such file or
  directory

So I changed it to bash and finally got somewhere:

  BASH-2.05a$ head -2 ./meta-play.sh
  #!/bin/bash
  [ -z "$1" ] && { echo "" ; echo "Whoa; gimma a disc ID like calix-01" ; e=
cho "" ; exit 1 ; }
  BASH-2.05a$ ./meta-play.sh

  Whoa; gimma a disc ID like calix-01

Great; now we're moving!  Having paid attention over the past few days,
as I write this it occurs to me that perhaps playing with chmod will let
me hit ../m and <tab> when I'm in a CD dir...

Sure enough, a simple a+x does!  I still have to have the shebang line
in there, though, and so I have some other scripts to fix, but I'm on
the way.


Thanks so much, everyone!

HAND

:-D
--=20
David T-G                      * It's easier to fight for one's principles
(play) davidtg AT justpickone DOT org * than to live up to them. -- fortune cookie
(work) davidtgwork AT justpickone DOT org
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!


--OwXh6gFRjCd3qPCM
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE8/V7uGb7uCXufRwARArOrAJ0Z6928MBjxKKP3C17N/qBd6lqZ+wCfVQZ5
UF+O+eYSW3Pc7uxH/PFMMjY=
=gpTT
-----END PGP SIGNATURE-----

--OwXh6gFRjCd3qPCM--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019