This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Command line arguments


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]