Search This Blog

Tuesday, September 18, 2012

How to run the Shell script file in Linux


In Linux Environment i am having the following shell script file.

Ex: setEnvironmentVariables.sh which contains the following

#!/bin/sh
DYNAMO_HOME=/ATG/ATG9.4/home
JAVA_HOME=/Weblogic/utils/bea1035/jdk1.6.0_29
WL=/Weblogic/utils/bea1035/user_projects/domains/ mydomain
WL_HOME=/Weblogic/utils/bea1035/wlserver_10.3
PATH=$JAVA_HOME/bin:$WL_HOME/server/bin:$PATH
export PATH

1.Syntax
               . setEnvironmentVariables.sh

This dot operator is very important.

2.While Running the shell scripts ,we dont need to mention the .sh because each shell script file should contain #!/bin/sh.This will be used  to  acknowledge that it was a shell script file.we can also run as follow.

           . setEnvironmentVariables


No comments:

Post a Comment