Hi

I was writing a few lines of script to change the  *pwd* of my BASH to my
*project workspace* whenever i call it (because its a long path)

#!/bin/bash
DIRECTORY="/home/varrun/Desktop/TODO/Final_yr_project"
if [ -d "$DIRECTORY" ]; then
        echo "exists"
        cd  $DIRECTORY
else
        echo "project directory either wrong or doesnt exist"
fi

When i run it, the directory of my terminal does *not* change i guess
because a child process cannot pass arguments to a parent process.
Is there any other way i can do this?

Also, why does it show an error when i change
DIRECTORY="~/Desktop/TODO/Final_yr_project"

-- 
Thanks & Regards
Varrun Ramani
Amrita University '10
Web: varrunr.wordpress.com
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to