Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8296809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:09:42+00:00 2026-06-08T15:09:42+00:00

Below is my shell script that I am trying to execute using PLINK on

  • 0

Below is my shell script that I am trying to execute using PLINK on MachineB from MachineA(Windows Machine).

#!/bin/bash
export HIVE_OPTS="$HIVE_OPTS -hiveconf mapred.job.queue.name=hdmi-technology"
hive -S -e 'SELECT count(*) from testingtable1' > attachment22.txt

I am using plink to execute the shell script like below,

C:\PLINK>plink uname@MachineB -m test.sh
Using keyboard-interactive authentication.
Password:
Using keyboard-interactive authentication.
Your Kerberos password will expire in 73 days.

And this is the below error I always get whenever I try to run like above.

sh: HIVE_OPTS= -hiveconf mapred.job.queue.name=hdmi-technology: is not 
an identifier

Something wrong with my shell script? or some trailing spaces? I am not able to figure it out. I am running PLINK from windows machine

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T15:09:45+00:00Added an answer on June 8, 2026 at 3:09 pm

    The sh: prefix on the error message indicates that the script is being executed by sh, not bash.

    bash lets you combine setting a variable and exporting it into a single command:

    export foo=bar
    

    sh, or at least some older versions of it, require these two actions to be separated:

    foo=bar ; export foo
    

    A version of sh that doesn’t recognize the export foo=bar syntax will interpret the string foo=bar as a variable name (and an illegal one, since it isn’t an identifier).

    Either arrange for the script to be executed by bash, or change this:

    export HIVE_OPTS="$HIVE_OPTS -hiveconf mapred.job.queue.name=hdmi-technology"
    

    to this:

    HIVE_OPTS="$HIVE_OPTS -hiveconf mapred.job.queue.name=hdmi-technology"
    export HIVE_OPTS
    

    For that matter, since you’re referring to $HIVE_OPTS at the very beginning of your script, it’s almost certainly already exported, so you could just drop the export.

    (You’ll also need to avoid any other bash-specific features.)

    So why is the system invoking the shell with sh? The #!/bin/bash syntax is specific to Unix-like systems. Windows generally decides how to execute a script based on the file extension; apparently your system is configured to invoke *.sh files using sh. (You could configure your system, using Folder Options, to invoke *.sh files using bash, but that might introduce other problems.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a shell script testShell.sh which uses getopts as below: #!/bin/bash while getopts
i am testing with the shell script below: #!/bin/ksh -x instance=`echo $1 | cut
So I'm trying to execute a shell script which produces a lot of output(in
I am using the below code for replacing a string inside a shell script.
I have a Unix shell script (bash) that sources some environment variables and then
Below is the snippet of a shell script from a larger script. It removes
How can i insert lines into a file using shell script such that they
I am trying to install ruby 1.9.2 from a ruby script using rvm which
I have a bash shell script that loops through all child directories (but not
I am trying to make a shell script that creates a mysql dump and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.