Shell script
Hi Friends,
I have a query about shell script. Simply when we write a simple script like:- cd /E*Fare/dist/src;pwd and executing the script from ~/aksutils location we can find in /E*Fare/dist/src location but pwd output still shows the location ~/aksutils. Thanks- Shankar |
When you use cd in a script the script will change back to the starting dir on exit - i.e. back where you began.
|
If you wish the script to be able to change the working directory in you current shell, you must source the script instead of running it as a command. For example:
Code:
$ pwd |
It's working perfectly.
I have also tried: $. ./testscript Thanks All. |
All times are GMT -5. The time now is 08:23 PM. |