This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Command line arguments
- From: Eliot Moss <moss at cs dot umass dot edu>
- To: cygwin at cygwin dot com
- Date: Tue, 30 Oct 2012 10:28:17 -0400
- Subject: Re: Command line arguments
- References: <1351606847888-94081.post@n5.nabble.com>
- Reply-to: moss at cs dot umass dot edu
On 10/30/2012 10:20 AM, chesschi wrote:
> In cygwin, is it possible to pass arguments to a shell script file? I have
> installed the latest cygwin with default packages. I found that argument
> zero ($0) is correct. However, the number of arguments always returns zero
> ($#= 0) and $1, $2... are all null even though I did pass arguments.
It is not clear what you mean by "in cygwin". If you run the bash shell,
for example, then it indeed makes the various arguments available as $1,
etc., and $# works as expected.
Perhaps you should give us more detail. I would suggest including:
- the script
- telling us the program from which you invoke the script (bash?), and
exactly how you invoke it
- one or more of the command lines that do not seem to work as you expect
I can assure you that I use bash and bash scripts, with arguments and
fancy argument processing, all the time ...
Regards -- Eliot Moss
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple