Mail Archives: cygwin/2002/01/18/03:23:54
From 'man bash':
-c string If the -c option is present, then commands are
read from string. If there are arguments after
the string, they are assigned to the positional
parameters, starting with $0.
. . .
ARGUMENTS
If arguments remain after option processing, and neither
the -c nor the -s option has been supplied, the first
argument is assumed to be the name of a file containing
shell commands. If bash is invoked in this fashion, $0 is
set to the name of the file, and the positional parameters
are set to the remaining arguments. Bash reads and exe-
cutes commands from this file, then exits. Bash's exit
status is the exit status of the last command executed in
the script. If no commands are executed, the exit status
is 0. An attempt is first made to open the file in the
current directory, and, if no file is found, then the
shell searches the directories in PATH for the script.
===
Which for is used is mostly a mater of taste. The effect is slightly
different though.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.
----- Original Message -----
From: "Surendar Singh Bisht" <suren AT duncaninfotech DOT com>
To: <cygwin AT cygwin DOT com>
Cc: "Corinna Vinschen" <cygwin AT cygwin DOT com>; <chet AT po DOT CWRU DOT Edu>
Sent: Thursday, January 17, 2002 22:03
Subject: RE: A small problem in Shell Scripts while using the built-in
"read" function -- Options not recognised
> Corinna Thanks !! & Thanks Chet!!
>
> The Workaround is doing great.
>
> Now the things are back in the places.
>
> -----Original Message-----
> From: Chet Ramey [mailto:chet AT nike DOT ins DOT cwru DOT edu]
> Sent: Thursday, 17 January 2002 7:52 PM
> To: cygwin AT cygwin DOT com
> Subject: Re: A small problem in Shell Scripts while using the built-in
> "read" function -- Options not recognised
>
>
> > The script is running under sh which is ash, not bash. ash doesn't
> > know these `read' options. As workaround prepend
> >
> > #!/bin/bash
> >
> > to your script or start it via `bash -c script'.
>
> Why the `-c'? `bash script' should work just fine.
--
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/
- Raw text -