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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:02:17+00:00 2026-06-17T17:02:17+00:00

Тhis is the first script I’ve ever written and I’m looking for some help.

  • 0

Тhis is the first script I’ve ever written and I’m looking for some help. I can’t find a script like the one I’m trying to write and its becoming a bother because I wish to create more/expand upon such a bash structure.

If some one has the time could they maybe proof read this for me. Could someone tell me what am I doing wrong and why?

#! /bin/bash
#  script to turn the screen blue
echo -e '\033[1;32m'
echo "Minecraft Server LTG Bukkit 1.4.7"
echo "Minecraft Server LTG Bukkit 1.4.7"
echo -e '\033[31m' "[Start  ] \033[1;32m LTG MineCraft Server"
echo -e '\033[31m' "[Stop   ] \033[1;32m LTG MineCraft Server"
echo -e '\033[31m' "[Restart] \033[1;32m LTG MineCraft Server"
echo -e '\033[0m'
cho -e "Hello, \033[47m \033[30m"$USER" \033[0m Enter Command:"

echo  "Command:"
read  $COM1 start stop restart

if ["$COM1" = "start"]:  then
       echo "ran minecraft serv"
     if [ "$(pgrep -g java -Xmx256M -Xms256M -jar /minecraft/minecraft_server.jar)" ] ; then
       echo MineCraft Server Bukkit 1.4.7 L.T.G : Running

     else
       echo -e "\033[1;32m MineCraft Server Bukkit 1.4.7 L.T.G : \033[31m  FAILED \033[0m"
     fi
if ["$COM1" "stop"]: then
    echo -e "\033[1;32m  MineCraft Server Bukkit 1.4.7 L.T.G : Shutting Down \033[0m"
    killall java
     if (( "$(pgrep -g java -Xmx256M -Xms256M -jar /minecraft/minecraft_server.jar)" )) ; then
    killall java
    echo -e "\033[1;32m MineCraft Server Bukkit 1.4.7 L.T.G: is SHUTDOWN \033[0m"
     fi
if [ "$COM1"  "Restart" ] ; then
     echo MineCraft Server Bukkit 1.4.7 L.T.G : Rebooting
     exit 1
 fi
fi
exit 0
  • 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-17T17:02:18+00:00Added an answer on June 17, 2026 at 5:02 pm

    Let’s take two lines…there’s enough there to keep us busy.

    read  $COM1 start stop restart
    
    if ["$COM1" = "start"]:  then
    

    The first line reads into a variable whose name is stored in $COM1 (which is uninitialized, so in fact it is empty, so it doesn’t do anything after all), plus the three variables start, stop, and restart. You either need:

    read COM1 start stop restart
    

    or you need to initialize COM1 before you use it.

    The second line manages to run into a surprising number of issues.

    1. The test command, aka [, is a command name, not a symbol. As such, it needs to be separated from its arguments. Note that there usually is a command /bin/[ or /usr/bin/[, though it is also a shell built-in these days.
    2. Fortunately, since $COM1 is unset and empty, it already is separated, but more by accident than design.
    3. Because of that, your [ command is executed with 3 arguments: =, ]: and then. This is not a valid invocation of [. The last argument should be ] on its own.
    4. You should use a semi-colon to separate the ] from the then.

    In aggregate, you should have written:

    if [ "$COM1" = "start" ]
    then
    

    or you can add a semi-colon (which does not have to be separated from the ] by a space) and then the then:

    if [ "$COM1" = "start" ]; then
    

    Stylistically, you have the string ‘Minecraft Server LTG Bukkit 1.4.7‘ repeated all over the place; don’t! Use a variable to hold it.

    Worry about your embedded cursor control sequences; different terminals have different sequences, so you’re restricted to a single terminal type. Fixing that is harder; investigate the tput command.

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

Sidebar

Related Questions

I am trying to write my very first python script. This was working but
First steps in FreeBSD: trying to run my installation script. Fast help needed: #
I have two scripts that are called in one program, the first script creates
Here's the story: I have to pass some classified information from one script to
I have written my first script for Greasemonkey, it is working great, except that
Not more than ten minutes ago I decided to write my first script for
My first script provides to random image as you can see below <script type=text/javascript
please bear with me because this is the first script I'm trying to build
I've ready some similar questions and have verified that jquery is the first script
I have two scripts. First script is asking user for some input and calling

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.