public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: cygwin@cygwin.com
Subject: Re: Command line arguments
Date: Tue, 30 Oct 2012 14:28:00 -0000	[thread overview]
Message-ID: <508FE401.3090906@cs.umass.edu> (raw)
In-Reply-To: <1351606847888-94081.post@n5.nabble.com>

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

  reply	other threads:[~2012-10-30 14:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30 14:21 chesschi
2012-10-30 14:28 ` Eliot Moss [this message]
2012-10-30 14:41   ` K Stahl
2012-10-30 19:30 ` Wynfield Henman
2012-10-31 18:24 ` Brian Wilson
2012-10-31 19:16   ` Andrew DeFaria
2012-10-31 19:40     ` David T-G
2012-10-31 20:29       ` Andrew DeFaria
2012-10-31 21:25         ` Andrew Defaria
2012-11-01 17:54       ` Brian Wilson
2012-11-01 18:01         ` Earnie Boyd
2012-11-01 20:49         ` Andrew DeFaria
2012-11-02 12:36           ` Earnie Boyd
2012-11-02 14:32             ` Andrew DeFaria
2012-11-02 14:54               ` Eliot Moss
2012-11-02 15:10                 ` Christopher Faylor

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=508FE401.3090906@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --cc=cygwin@cygwin.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).