LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 02-10-2016, 08:34 AM   #1
raahool_16
LQ Newbie
 
Registered: Feb 2016
Posts: 2

Rep: Reputation: Disabled
Error installing devStack [[ -v "$1" ]] -> [conditional binary operator expected]


I am trying to install dev-stack in a CentOS VM. When I run the create-stack-user.sh file by the command:
Code:
$ bash devstack/tools/create-stack-user.sh
I am getting the below error:
Code:
/opt/devstack/functions-common: line 162: conditional binary operator expected
On looking at the file, create-stack-user.sh I have seen that it calls an another shell script file "functions-common" and upon looking at the line number from where the error is reported, I found the below function there:
Code:
function isset {
    [[ -v "$1" ]]
}
I tried the same command with echo and same error occurred:
Code:
echo `[[ -v "$1" ]]`
bash: command substitution: line 1: conditional binary operator expected
bash: command substitution: line 1: syntax error near `"$1"'
bash: command substitution: line 1: `[[ -v "$1" ]]'
Please suggest where is it going wrong..!!
 
Old 02-10-2016, 01:42 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
What version of CentOS?

The problem is that your shell does not recognize the "-v" operator ("True if the shell variable varname is set (has been assigned a value)"). Mine doesn't, either (bash 4.1.2, CentOS 6.7).

You can try modifying that function this way:
Code:
function isset {
    [[ ${1-is_not_set} != is_not_set ]]
}
But, you may run into other issues with a package designed for a shell that is newer than yours.
 
1 members found this post helpful.
Old 02-18-2016, 10:09 PM   #3
raahool_16
LQ Newbie
 
Registered: Feb 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
What version of CentOS?

The problem is that your shell does not recognize the "-v" operator ("True if the shell variable varname is set (has been assigned a value)"). Mine doesn't, either (bash 4.1.2, CentOS 6.7).

You can try modifying that function this way:
Code:
function isset {
    [[ ${1-is_not_set} != is_not_set ]]
}
But, you may run into other issues with a package designed for a shell that is newer than yours.
It was CentOS-6.4. Anyways thanks for your response. I will give it a try. In the mean time I shifted to Ubuntu & it worked there.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
During test of a file, binary operator expected error Masoom Linux - Newbie 12 08-13-2015 03:44 AM
NEWBIE ....need some help with "unary operator expected" error msg learning78 Linux - Newbie 6 11-11-2010 12:21 AM
Binary Operator Expected error in Shell Script mangatmodi Programming 9 10-25-2009 01:36 AM
Binary operator expected - error mike9287 Linux - Newbie 9 07-17-2006 08:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 12:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration