Tiny Core Linux
Off-Topic => Off-Topic - Tiny Core Lounge => Topic started by: bigpcman on January 11, 2009, 06:42:52 PM
-
I've hunted around for an answer to why the busybox ash shell won't execute this little script (actually just a function of a larger script) but the bash shell will. I wonder if there is a simple change that would make it acceptable for the ash shell. Anyway since there are so many experts on this forum I thought someone would know the answer. The error message is:
./test: line 3: syntax error: "(" unexpected
#!/bin/sh
function testport() {
if netstat -an | egrep ":$1 .*LISTEN" > /dev/null
then
return 0
else
return 1
fi
}
-
Just use myfunction()
Having 'function' is redundant anyways :)
(it's probably a 'bashism')
-
Great! Thanks that fixed the problem.