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]

functions in /bin/sh scripts causing "unexpected "("" errors


I searched the archives, FAQ and general web but didn't find an answer for this.

I'm observing the following error when I attempt to run shell scripts
with  functions in a cygwin shell. These scripts work as expected on
my linux machines.

$ ./functest
./functest: 3: Syntax error: "(" unexpected
$ cat functest
#!/bin/sh

function helloworld () {
        echo "Hello, World!"
}

helloworld();

(The functest script above is attached as is my output to cygcheck.)

I also found that if I uncommented the example function line included
in /etc/skel/.bashrc, the same error resulted. The line is:

# Some example functions
function settitle() { echo -n "^[]2;$@^G^[]1;$@^G"; }

I'm guessing that this is a bug in this particular version of sh on
cygwin but, as I mentioned above, I haven't been able to find anything
on it  -- perhaps because the error is so common in programming so
there's too much other information.

Any ideas?

Thank you.

-kw

Attachment: functest
Description: Binary data

Attachment: cygcheck.out
Description: Binary data

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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]