728x90
stigala
July 12th, 2007, 04:33 AM
Hi,
I'm trying to run a script on ubuntu 7.04;
stig@stig-laptop:~/mosesdecoder$ ./regenerate-makefiles.sh
./regenerate-makefiles.sh: 13: Syntax error: "(" unexpected
but then I get the syntax error. Below is the first lines in the script, line 13 in red.
#!/bin/sh
# NOTE:
# Versions 1.9 (or higher) of aclocal and automake are required.
# For Mac OSX users:
# Standard distribution usually includes versions 1.6.
# Get versions 1.9 or higher
# Set the following variable to the correct paths
#ACLOCAL="/path/to/aclocal-1.9"
#AUTOMAKE="/path/to/automake-1.9"
function die () {
echo "$@" >&2
exit 1
}
...
I already have automake (GNU automake 1.9.6) and aclocal (GNU automake 1.9.6). Setting the paths is only for Mac OSX users, so I didn't try to set any of those paths.
Anyone can explain this? Thanks for any help,
Stig
I'm trying to run a script on ubuntu 7.04;
stig@stig-laptop:~/mosesdecoder$ ./regenerate-makefiles.sh
./regenerate-makefiles.sh: 13: Syntax error: "(" unexpected
but then I get the syntax error. Below is the first lines in the script, line 13 in red.
#!/bin/sh
# NOTE:
# Versions 1.9 (or higher) of aclocal and automake are required.
# For Mac OSX users:
# Standard distribution usually includes versions 1.6.
# Get versions 1.9 or higher
# Set the following variable to the correct paths
#ACLOCAL="/path/to/aclocal-1.9"
#AUTOMAKE="/path/to/automake-1.9"
function die () {
echo "$@" >&2
exit 1
}
...
I already have automake (GNU automake 1.9.6) and aclocal (GNU automake 1.9.6). Setting the paths is only for Mac OSX users, so I didn't try to set any of those paths.
Anyone can explain this? Thanks for any help,
Stig
Rui Pais
July 12th, 2007, 05:01 AM
Hi.
the (inexistent) problem is the 1st line in combination with Ubuntu.
When you run it using ./ it will use the shell you mention on first line, in your case:
#!/bin/sh
if you do a ls -l /bin/sh you will see that it's just a link to dash.
Ubuntu, since Edgy, replaced old sh with dash, creating a series of incompatibilities in a lot of scripts...
So, either you run:
bash regenerate-makefiles.sh
or replace first line with:
#!/bin/bash
(or even remove the 1st line and environment will call it with bash)
or (losing generality) adapt it for dash:
remove the keyword function:
die() {
...
}
hth
the (inexistent) problem is the 1st line in combination with Ubuntu.
When you run it using ./ it will use the shell you mention on first line, in your case:
#!/bin/sh
if you do a ls -l /bin/sh you will see that it's just a link to dash.
Ubuntu, since Edgy, replaced old sh with dash, creating a series of incompatibilities in a lot of scripts...
So, either you run:
bash regenerate-makefiles.sh
or replace first line with:
#!/bin/bash
(or even remove the 1st line and environment will call it with bash)
or (losing generality) adapt it for dash:
remove the keyword function:
die() {
...
}
hth
구닥다리 dash로 실행되는 녀석을 bash로 실행되도록 해놓으란 말
파일의 첫줄을
#!/bin/sh ==> #!/bin/bash
이렇게 바꾸니까 된다.
728x90
'Programming > linux왕초보' 카테고리의 다른 글
Qt Cross compile (0) | 2012.08.20 |
---|---|
perl : Can't locate Term/ReadKey.pm ERROR (0) | 2012.05.22 |
(target: Desktop) When executing build step 'qmake' (1) | 2012.05.21 |
android compile error: host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp (0) | 2012.04.26 |
kernel make menuconfig: needs ncurses? (0) | 2012.04.25 |
arm kernel 컴파일도중 u-boot 들먹이며 거절할 때 (0) | 2012.04.23 |
find 명령어(linux) (4) | 2012.04.03 |
ALSA SoC Layer (0) | 2012.04.03 |
ubuntu 바탕화면에 휴지통 꺼내놓기 (0) | 2012.03.30 |
ALSA (0) | 2012.03.26 |