Quote:
Originally Posted by
c00kie88
I made a script using VI editor called "script", save the file at /home/blah/test
#!/bin/sh
echo "Please enter the dir"
/home/blah
read input
echo $input
/home/blah
cd $input
go back to prompt.
and when i do "PWD" command, i'm still at /home/blah/test
what do u type in at the read input line?
does the directory exist???
in short:
carry out the following steps:
1. create a directory
$ mkdir varun
2. create a file change.sh and type in the nxt 2 lines
$ vi change.sh
~echo "enter a directory"
~read dir
~cd $dir
~
~
3. save the file and exit.
:wq!
"change.sh" 3L, 48C written
4. Now run this file
$ . change.sh
enter a directory:
varun
varun$
This thread has carried on too far now.
Just follow the steps above.
If it doesn't work then lets assume that u r using a customized version of unix which may have some differences.....
or u might not be disclosing all the relevant info thats needed