[ :Unexpected operator in shell programming

This is for Hadoop eco system like HDFS, Map reduce, Hive, Hbase, Pig, sqoop,sqoop2, Avro, solr, hcatalog, impala, Oozie, Zoo Keeper and Hadoop distribution like Cloudera, Hortonwork etc.
ram123
Posts: 43
Joined: Sat Jan 27, 2018 3:55 am
Contact:

[ :Unexpected operator in shell programming

Postby ram123 » Wed Feb 28, 2018 3:36 am

getting below error while run using sh script.sh

: -checkDupOutput: unexpected operator
daily_merge.sh: 64: [: -checkDupOutput: unexpected operator
daily_merge.sh: 69: [: -checkDupOutput: unexpected operator
daily_merge.sh: 75: [: -checkDupOutput: unexpected operator


ram123
Posts: 43
Joined: Sat Jan 27, 2018 3:55 am
Contact:

Re: [ :Unexpected operator in shell programming

Postby ram123 » Wed Feb 28, 2018 3:38 am

I think below will solve error.

POSIX sh don'tt understand == for string equality, as that is a bash-ism. Use = instead of ==.

sachin23
Posts: 25
Joined: Sat Jan 27, 2018 4:05 am
Contact:

Re: [ :Unexpected operator in shell programming

Postby sachin23 » Wed Feb 28, 2018 3:43 am

use # instead of ##

run script with ./script.sh



Return to “Hadoop and Big Data”

Who is online

Users browsing this forum: No registered users and 0 guests