bash scripting newbie

hi guys

I am new to bash shell scripting and have a few questions. I am from a java background.

Below is my file which invokes the customer.jar
1.  I want to modify my file so i do
$ vi
but it does not allow me to modify(it is read only), any idea why?
How can i make it editable?


export JAVA_HOME=/javaProj/jdk/1.6.0_22   
export PATH=$JAVA_HOME/bin:$PATH:$LD_LIBRARY_PATH   #  I am not sure what is $PATH:$LD_LIBRARY_PATH , any idea
export CLASSPATH=$CLASSPATH:$ROOT     #  I am not sure what is $CLASSPATH, any idea
export ROOT=/project/customer/customerAutomated

 touch $ROOT/customer.log   # does touch means it creates a file?
chmod 0777 $ROOT/customer.log



emailSubject="ERROR:- customer Status on `date`"


echo " " ; echo "BEGIN TIME = `date`"

cd $ROOT

java -Dicg.env=prod  -jar $ROOT/customer.jar 123    # any idea what this means 'java -Dicg.env=prod'
sleep 2      # this makes the program sleep for 2 seconds, right ?

echo "Checking Logs..."
if ( grep "Problem occurred" $logAutos );
        echo "Alert: Problem occurred while updating customertables..."        
        echo "END TIME = `date`"
        exit 1

echo "END TIME = `date`"
exit 0

Open in new window

Any help will be greatly appreciated
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris HInfrastructure ManagerCommented:
Push I to enable insert mode

push esc to exit insert mode

type :wq to write and quit.
Steven CarnahanNetwork ManagerCommented:
What are the permissions on the file?  

ls -l

Please post the results.

Also, when in the file using vi you move the cursor to where you want to edit it and press the insert key to be able to edit. When complete you press the Esc key twice and the enter a colon and a "w" without the quotes to save the file.
royjaydAuthor Commented:
thanks , pressing the insert key works
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

royjaydAuthor Commented:
can you please help me with the questions i posted with in the script?

What are the permissions on the file?
ls -l
shows that you do not have write permission, and that you are the owner of the file, you can
chmod u+w
If you are not the owner, then you may have to ask the owner to grant you permission.
royjaydAuthor Commented:
ls -l

-rwxrwxrwx 1 customerproj customerproj 1745 Jan 30 18:07
Steven CarnahanNetwork ManagerCommented:
Line 4:     I am not sure what is $PATH:$LD_LIBRARY_PATH , any idea

You can temporarily substitute a different library for this particular execution. In Linux, the environment variable LD_LIBRARY_PATH is a colon-separated set of directories where libraries should be searched for first, before the standard set of directories; this is useful when debugging a new library or using a nonstandard library for special purposes. The environment variable LD_PRELOAD lists shared libraries with functions that override the standard set, just as /etc/ does. These are implemented by the loader /lib/ I should note that, while LD_LIBRARY_PATH works on many Unix-like systems, it doesn't work on all; for example, this functionality is available on HP-UX but as the environment variable SHLIB_PATH, and on AIX this functionality is through the variable LIBPATH (with the same syntax, a colon-separated list).

LD_LIBRARY_PATH is handy for development and testing, but shouldn't be modified by an installation process for normal use by normal users; see ``Why LD_LIBRARY_PATH is Bad'' at for an explanation of why. But it's still useful for development or testing, and for working around problems that can't be worked around otherwise. If you don't want to set the LD_LIBRARY_PATH environment variable, on Linux you can even invoke the program loader directly and pass it arguments. For example, the following will use the given PATH instead of the content of the environment variable LD_LIBRARY_PATH, and run the given executable:   /lib/ --library-path PATH EXECUTABLE
Just executing without arguments will give you more help on using this, but again, don't use this for normal use - these are all intended for debugging.

Line 5:        I am not sure what is $CLASSPATH, any idea

Line 8:        does touch means it creates a file?

Has much more capability than simply creating a file:

Line 23:       any idea what this means 'java -Dicg.env=prod'

Truthfully I don't know java that well.

Line 24:        this makes the program sleep for 2 seconds, right


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
man java
java(1)                                                                                                                                                  java(1)

       java - Java application launcher

       java [ options ] class [ argument...  ]

       java [ options ] -jar file.jar
            [ argument...  ]
       The launcher has a set of standard options that are supported on the current runtime environment and will be supported in future releases.  In  addition,
       the current impletmentations of the virtual machines support a set of non-standard options that are subject to change in future releases.

   Standard Options
              Sets a system property value.
royjaydAuthor Commented:
thanks guys

>> -Dproperty=value
              Sets a system property value.

Can you tell me where i can find it ? where can i see my system properties?
Can i do a search on my system properties

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.