Link to home
Start Free TrialLog in
Avatar of Jay Roy
Jay RoyFlag for United States of America

asked on

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 customer.sh file which invokes the customer.jar
1.  I want to modify my customer.sh file so i do
$ vi customer.sh
but it does not allow me to modify(it is read only), any idea why?
How can i make it editable?

customer.sh

#!/bin/bash

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

logAutos=$ROOT/autosys.log

emailFailFile=$ROOT/emailfail.txt

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

sendtotargetName="jacks@humpingtree.com"

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 );
then
        echo "Alert: Problem occurred while updating customertables..."        
        echo "END TIME = `date`"
        exit 1
fi

echo "END TIME = `date`"
exit 0

Open in new window


Any help will be greatly appreciated
thanks
SOLUTION
Avatar of Chris H
Chris H
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jay Roy

ASKER

thanks , pressing the insert key works
Avatar of Jay Roy

ASKER

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

thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jay Roy

ASKER

ls -l customer.sh

-rwxrwxrwx 1 customerproj customerproj 1745 Jan 30 18:07 customer.sh
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jay Roy

ASKER

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

thanks