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 8303269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:29:13+00:00 2026-06-08T17:29:13+00:00

#!/bin/bash export HIVE_OPTS=$HIVE_OPTS -hiveconf mapred.job.queue.name=hdmi-technology export HIVE_AUX_JARS_PATH=/home/hadoop/lib/HiveUDF.jar hive -S -e ‘set mapred.job.queue.name=hdmi-technology’ hive -S

  • 0
#!/bin/bash
export HIVE_OPTS="$HIVE_OPTS -hiveconf mapred.job.queue.name=hdmi-technology"
export HIVE_AUX_JARS_PATH=/home/hadoop/lib/HiveUDF.jar
hive -S -e 'set mapred.job.queue.name=hdmi-technology'
hive -S -e 'SELECT count(*) from testingtable2' > attachment.txt

Whenever I try to run the above shell script(count.sh) like below, I always get errors, I have no idea what wrong I am doing as I am new to shell script and I am not sure how I can add environment variables in shell script.

bash-3.00$ sh count.sh
count.sh: HIVE_OPTS= -hiveconf mapred.job.queue.name=hdmi-technology^M: is not an
identifier

Is there anything wrong I am doing in my shell script, by the way I am adding environment variables in first two lines? Any help will be appreciated.

After all the changes I did as per the below comments,

mv count.sh count, 
chmod +x count, 
./count

whenever I try to do this in my prompt directly export HIVE_AUX_JARS_PATH=/home/hadoop/lib/HiveUDF.jar it works fine, but whenever I try to add this in my shell script as mentioned in my question, I always get ‘java.io.FileNotFoundException(File file:/home/hadoop/lib/HiveUDF.jar does not exist. Why is it so?

  • 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-08T17:29:14+00:00Added an answer on June 8, 2026 at 5:29 pm

    You edited your shell script on a DOS or Windows machine, which uses the CRLF pair (\r\n) instead of the Unix-style LF (‘\n’) line endings.

    The ^M is the tell-tale — it is a \r carriage return character.

    This should fix it:

    tr -d '\r' < count.sh > count.sh.fixed
    mv count.sh.fixed count.sh
    

    Another option:

    sed -i 's/\r//g' count.sh
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#!/bin/bash kommando=java -jar '/home/git/yuicompressor-2.4.7/build/yuicompressor-2.4.7.jar' gitdir='/home/git/repositories/gitosis-admin.git/gitosis-export/dev/www/res/' echo Vil Du versionere ? (ja/nej) read yesno if
I wrote the following shell script: #!/bin/bash MAIL=/usr/mail/${LOGNAME:?} . /installations/etl_scripts/etl_job.properties JOB_LOG_FILE_PATH=$JOB_LOG_FILE_PATH export JOB_LOG_FILE_PATH JOB_LOG_FILE_NAME=$JOB_LOG_FILE_NAME
Say the following Bash script: #!/bin/bash export TEXTDOMAINDIR=./locale export TEXTDOMAIN=test-gettext-read . gettext.sh echo -n
I wrote a little bash script to export environment variable: #!/bin/bash echo Pass a
I have a simple bash script: #!/bin/bash JAVA_HOME=/usr EC2_HOME=~/ec2-api echo $EC2_HOME export PATH=$PATH:$EC2_HOME/bin I
I have a code like this: #!/usr/bin/env bash test_this(){ export ABC=ABC echo some output
I have the following bash script: #!/bin/bash FILE=p.txt while read line; do export http_proxy=http://$line
#!/bin/bash echo SCRIPT: $0 echo Enter Customer Order Ref (e.g. 100018) read P_CUST_ORDER_REF echo
#! /bin/bash # # clear_ram.sh - Clear as much user-space ram as possible #
#!/bin/bash echo 'first line' >foo.xml echo 'second line' >>foo.xml I am a total newbie

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.