Register
It is currently Sun Dec 21, 2014 12:29 am

trying to fix [: 359: 11: unexpected operator


All times are UTC - 6 hours


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPosted: Wed Aug 25, 2010 1:00 pm   

Joined: Wed Aug 25, 2010 12:54 pm
Posts: 3
hello,

my knowledge of scripts is pretty basic.
i'm having problems running gridengine apparently because their startup script is somehow failing in my box (ubuntu 10.04) and i didn't get help from their forums.

when i source settings.sh i get:

[: 359: 11: unexpected operator
[: 359: 11: unexpected operator
[: 359: 11: unexpected operator
[: 359: 11: unexpected operator
[: 359: 11: unexpected operator
[: 359: 11: unexpected operator

here's the script:

SGE_ROOT=/share/sge/ge6.2u5; export SGE_ROOT

ARCH=`$SGE_ROOT/util/arch`
DEFAULTMANPATH=`$SGE_ROOT/util/arch -m`
MANTYPE=`$SGE_ROOT/util/arch -mt`

SGE_CELL=default; export SGE_CELL
SGE_CLUSTER_NAME=p6444; export SGE_CLUSTER_NAME
SGE_QMASTER_PORT=6444; export SGE_QMASTER_PORT
SGE_EXECD_PORT=6445; export SGE_EXECD_PORT

if [ "$MANPATH" = "" ]; then
MANPATH=$DEFAULTMANPATH
fi
MANPATH=$SGE_ROOT/$MANTYPE:$MANPATH; export MANPATH

PATH=$SGE_ROOT/bin/$ARCH:$PATH; export PATH
# library path setting required only for architectures where RUNPATH is not supported
case $ARCH in
sol*|lx*|hp11-64)
;;
*)
shlib_path_name=`$SGE_ROOT/util/arch -lib`
old_value=`eval echo '$'$shlib_path_name`
if [ x$old_value = x ]; then
eval $shlib_path_name=$SGE_ROOT/lib/$ARCH
else
eval $shlib_path_name=$SGE_ROOT/lib/$ARCH:$old_value
fi
export $shlib_path_name
unset shlib_path_name old_value
;;
esac
unset ARCH DEFAULTMANPATH MANTYPE

help please?
thx


Top
 Profile  
 PostPosted: Wed Aug 25, 2010 1:40 pm   
User avatar

Joined: Sun Jun 27, 2010 12:57 am
Posts: 192
The default shell (/bin/sh) of Ubuntu used to be 'dash'. A nice shell just not as nice as 'bash'.
(you can check by doing an 'ls -l /bin/sh' in a terminal)
If your scripts starts with '#!/bin/sh' try changing it to '#!/bin/bash' instead and run the script again.
If it doesn't, just put it as the first line anyway :)
Or you can link '/bin/sh' to '/bin/bash' and make bash your default shell.
That used to be the root cause of a lot of my problems.


Top
 Profile  
 PostPosted: Wed Aug 25, 2010 2:00 pm   

Joined: Wed Aug 25, 2010 12:54 pm
Posts: 3
hey, thx for the quick reply. but i still get the same problem :(
i added #!/bin/bash to the first line and made chmod +x settings.sh to avoid source-ing it (not sure what the 'source' command does).
i still get:

$ ./settings.sh
[: 359: 11: unexpected operator
[: 359: 11: unexpected operator
[: 359: 11: unexpected operator
[: 359: 11: unexpected operator
[: 359: 11: unexpected operator
[: 359: 11: unexpected operator


Top
 Profile  
 PostPosted: Wed Aug 25, 2010 2:07 pm   

Joined: Wed Aug 25, 2010 12:54 pm
Posts: 3
an update: although i still get the error messages, at least now the PATHs are properly set and the basic gridengine commands will run. that's an improvement! :) should i still worry about the "[: 359: 11: unexpected operator" messages?


Top
 Profile  
 PostPosted: Mon Aug 30, 2010 5:29 am   
User avatar

Joined: Tue Apr 27, 2010 2:28 pm
Posts: 172
Location: Czech Republic
prtc wrote:
an update: although i still get the error messages, at least now the PATHs are properly set and the basic gridengine commands will run. that's an improvement! :) should i still worry about the "[: 359: 11: unexpected operator" messages?

Yes, you should worry. The error is not reported by bash, I'd guess, at least my bash says "line 359" instead of just the line number. So, the error lies somewhere deeper in one of the called scripts, still interpreted by dash or some other shell.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP