This is the mail archive of the cygwin@cygwin.com 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]

Linux bash vs. Cygwin bash and $1


Hey everyone,

I'm having some difficulty with some bash scripts that work fine on my
Linux machine, but do not work as expected on my XP machine running
Cygwin.  First off, I was searching the FAQ's and google.com for
differences between Linux bash and Cygwin bash and did not find
information I was looking for.  Does anyone know of such a reference
online?

Here is an example; I have the following script named "vcmp":

#!/bin/bash
echo "***** Listing ONLY differences..."
echo $#
if [ $# -gt 1 ]; then
  cvs -n -q update $@
else
  cvs -n -q update
fi

echo $0
echo $1
echo $2

echo "*****  CVS Compare Complete..."


I execute the command "vcmp resync_all"

In Linux bash, I get the following values:
$#  :  1
$0  :  ./vcmp
$1  :  resync_all
$2  : (null)

In Cygwin, I get the following values:
$#  :  2
$0  : /usr/cvs/cvs_scripts/vcmp
$1  :  !*   <-- where did this come from?
$2  :  resync_all

I am perplexed as to why I'm getting "!*" for $1 ?

There also seems to be a difference on what Linux considers to be the
first argument versus what Cygwin considers as the first argument.
Perhaps I am doing something incorrectly that I am not aware of...

Thanks in advance for any information!






--
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/


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