Home » Infrastructure » Unix » Shell script (Unix)
Shell script [message #433269] |
Tue, 01 December 2009 02:55  |
prejib
Messages: 126 Registered: March 2009 Location: India
|
Senior Member |
|
|
Hi,
I want to write an executable file in unix env to go to a particular path instead of always typing the long path cd /app/oracle/product/10.2.0/Db_1/scripts/prejib/sample.
I have tried with the below script in but not working . please help me
bash-3.00$ cat a.sh#!/bin/sh
mypath=/app/oracle/product/10.2.0/Db_1/scripts/pressy/sample
echo $mypath
cd $mypath
bash-3.00$ chmod +x a.sh
bash-3.00$ sh a.sh
/app/oracle/product/10.2.0/Db_1/scripts/pressy/sample
bash-3.00$ pwd
/app/oracle/product/10.2.0/Db_1/scripts/pressy
bash-3.00$
After executing the file a.sh, I am in the same path only
|
|
|
|
|
|
 |
Goto Forum:
Current Time: Sun May 04 12:53:10 CDT 2025
|