![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| unary operator expected | Satyak | Shell Programming and Scripting | 2 | 03-06-2009 02:56 PM |
| awk returning "[: ==: unary operator expected" | theamrit | Shell Programming and Scripting | 2 | 11-03-2008 01:51 PM |
| unary operator expected error | ssuresh1999 | UNIX for Dummies Questions & Answers | 2 | 10-28-2008 09:33 PM |
| Binary operator expected | basisvasis | Shell Programming and Scripting | 4 | 09-26-2008 04:33 PM |
| binary operator expected error | apps_user | Shell Programming and Scripting | 7 | 05-11-2007 07:33 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
[: =: unary operator expected
HI,
while running a script, I got the below mentioned error. /bin/sh: line10 : [: = : unary operator expected. I tried to follow the solution for these kind of problem that is "QUOTING THE VARIABLES" , but it is invain. Can any one help me in resolving the issue? I am pasting the actual content of the script below.plz check it. I am having problem with the code in red. Code:
supportedMozillaVersion() {
case "$*" in
*rv:1.[7-9]*) return 0;;
*rv:[2-9].[0-9]*) return 0;;
*rv:*) return 1;;
Mozilla\ 1.[7-9]*) return 0;;
Mozilla\ [2-9].[0-9]*) return 0;;
*) return 1;;
esac
}
supportedFirefoxVersion() {
case "$*" in
*Firefox\ [1-9].*) return 0;;
*Firefox/[1-9].*) return 0;;
*Firefox*) return 1;;
*rv:1.[7-9]*) return 0;;
*rv:[2-9].*) return 0;;
*rv:*) return 1;;
Mozilla*\ 1.[7-9]*) return 0;;
Mozilla*\ [2-9].[0-9]*) return 0;;
*) return 1;;
esac
}
whichBrowser=NoBrowser
case "$0" in
/*) fullpath=$0;;
*) fullpath=`pwd`/$0;;
esac
installsourcepath=`echo "$fullpath" | sed "s,/\./,/,g; s,/[^/][^/]*/\.\./,/,g; s,//,/,g; s,/[^/]*$,,"`
if [ "$BROWSER" ]; then
if versionString=`($BROWSER -version) 2>/dev/null`; then
case "$versionString" in
*Firefox*) if supportedFirefoxVersion "$versionString"; then
whichBrowser=Firefox
fi ;;
*Mozilla*) if supportedMozillaVersion "$versionString"; then
whichBrowser=Mozilla
fi ;;
esac
fi
fi
Last edited by radoulov; 03-10-2009 at 07:15 AM.. Reason: added code tags |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|