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

  • Home
  • SEARCH
  • 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 7000113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:37:46+00:00 2026-05-27T20:37:46+00:00

My following script is producing an error (it complains about expecting ‘then’ keyword before

  • 0

My following script is producing an error (it complains about expecting ‘then’ keyword before the file exits. I can’t locate the error. Please help if you have the time.

Thank you,
Yucca

#!/bin/sh
#Makes the /usr/lib/jvm in case...
sudo mkdir -p /usr/lib/jvm;
sudo mkdir /org-thejarbar-work-dir;
cd /org-thejarbar-work-dir;

#Update this line to reflect newer versions of JDK...
wget http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.tar.gz;

#Extract the download
tar -xvf ./*gz;

#Move it to where it can be found...
sudo mv ./* /usr/lib/jvm/;
sudo ln -s /usr/lib/jvm/jdk1*/bin/java /usr/bin/;
sudo rm -rf /org-thejarbar-work-dir;

#Makes the /usr/lib/maven in case...
sudo mkdir -p /usr/lib/maven;
sudo mkdir /org-thejarbar-work-dir;
cd /org-thejarbar-work-dir;

#Update this line to reflect newer versions of maven
wget http://mirrors.powertech.no/www.apache.org/dist//maven/binaries/apache-maven-3.0.3-bin.tar.gz;
tar -xvf ./*gz;

#Move it to a more logical location
sudo mv ./* /usr/lib/maven/;

#If you have Maven on Windows and use VirtualBox, you can set up the maven to be a virtualbox shared folder.
#The name must match the name used below (ignore if irrelevant to you).
sudo mount -t vboxsf maven /usr/lib/maven;

#Link the new Maven to the bin...
sudo ln -s /usr/lib/maven/apache-maven-*/bin/mvn /usr/bin/;
sudo rm -rf /org-thejarbar-work-dir;
sudo mkdir /org-thejarbar-work-dir;
cd /org-thejarbar-work-dir;

#Update this line to reflect newer versions of Netbeans or replace 'javase' with 'javaee' or add Java EE manually via
#Netbeans 'plugins as needed.
wget http://download.netbeans.org/netbeans/7.0.1/final/bundles/netbeans-7.0.1-ml-javase-linux.sh;
sh //*sh;
sudo mv ./* /usr/lib/ide/;

#Add Netbeans launcher to your PATH. Doing so allows you to run 'netbeans' command from the terminal
sudo ln -s /usr/lib/ide/netbeans-7*/bin/netbeans /usr/bin/;

#If you use VirtualBox , you can share your projects between Host and guest. Name of shared
#folder must match 'NetBeansProjects' Remove this if you don't need...
if [ ! -d "~/NetBeansProjects" ]; then
    sudo mkdir ~/NetBeansProjects;
fi

sudo mount -t vboxsf NetBeansProjects ~/NetBeansProjects;
sudo rm -rf /org-thejarbar-work-dir;
sudo mkdir /org-thejarbar-work-dir;
cd /org-thejarbar-work-dir;

#Update this line to reflect newer versions of Netbeans or replace 'javase' with 'javaee' or add Java EE manually via
#Netbeans 'plugins as needed.
wget http://download.netbeans.org/netbeans/7.0.1/final/bundles/netbeans-7.0.1-ml-javase-linux.sh;
sh //*sh;
sudo mv ./* /usr/lib/ide/;

#Add Netbeans launcher to your PATH. Doing so allows you to run 'netbeans' command from the terminal
sudo ln -s /usr/lib/ide/netbeans-7*/bin/netbeans /usr/bin/;

#If you use VirtualBox , you can share your projects between Host and guest. Name of shared
#folder must match 'NetBeansProjects' Remove this if you don't need...
if [ ! -d "~/NetBeansProjects" ]; then
    sudo mkdir ~/NetBeansProjects;
fi

sudo mount -t vboxsf NetBeansProjects ~/NetBeansProjects;
sudo rm -rf /org-thejarbar-work-dir;
sudo mkdir /org-thejarbar-work-dir;
cd /org-thejarbar-work-dir;
sudo wget http://download-ln.jetbrains.com/idea/ideaIC-11.tar.gz
sudo tar -zxvf ./*.gz;

#Move it to a better location...
sudo rm -rf /usr/lib/ide/idea-IC*;
sudo mv ./* /usr/lib/ide/;

#Add IDEA launcher to your PATH. Doing so allows you to run 'idea.sh' command from the terminal
rm /usr/bin/idea.sh;
sudo ln -s /usr/lib/ide/idea-IC*/bin/idea.sh /usr/bin/;

#If you use VirtualBox , you can share your projects between Host and guest. Name of shared
#folder must match 'IdeaProjects' Remove this if you don't need...
if [ ! -d "~/IdeaProjects" ]; then
    sudo mkdir ~/IdeaProjects;
fi

sudo rm -rf /org-thejarbar-work-dir;

exit 0;

Note that the script works (does what is required), but the error is bothersome as I am working on sharing this script to others. I am trying to avoid the error.

  • 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-05-27T20:37:47+00:00Added an answer on May 27, 2026 at 8:37 pm

    First of all, that’s not a bash script right now – it’s a bourne shell script. If you want to use bash change the first line (the “shebang”) to use /bin/bash. You showed with your comment that /bin/sh is actually dash in your system. dash is a minimal implementation of the bourne shell.

    You can debug a bash script by running it with -x, as in: /bin/bash -x script.sh; or changing the shebang to #!/bin/bash -x (temporarily).

    As an aside, you’re testing for directories and creating them if they don’t exist. If that’s all you’re going to do inside the if clauses you can use a plain mkdir -p so it doesn’t raise an error if the path already exists. Note it may not be available in all *nix systems, but it is in GNU/Linux.

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

Sidebar

Related Questions

I have <supportedProfiles>extendedDesktop</supportedProfiles> in my Application.xml file, but the following is producing this error:
The following script print some characters. how to print the characters to file (
I have the following script, which is in an external file called at the
I have the following script, which should be producing errors, but it does not:
The following script is not outputting error messages to the browser. Instead it results
i have the following script and i can't find out how to use the
I am writing following script to read list of servers from the text file
the following script (test.pl) append $insert[1] text between $first_line[1] and $second_line[1] on myfile.txt file
the following script.bin append by tee lines to file.log (from my bash script) IP=xxx.xxx.xxx.xxx
The following script will delete files in a named directory that are older than

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.