putting a path into a varaible and change directory
I have this script that just unzips a few files.
I have labeled this directory in the "basename" name space. Which is great becuase I don't have to write out the whole thing in the line every time I reference the path. However the script does not change to the directory. The "cd to $basename" does not work. the script does not switch to the basename direcotry after it is done . Code:
#!/bin/bash |
$basepath undefined.
cd $base_path |
Could be a typo but the shell does not inherit a program's environment (actually it is a child process) even though you change directories from within the script once it exists your back where you started.
|
Or you can use pushd/popd to change directories and return to the stored directories when you're done.
Cheers |
All times are GMT -5. The time now is 11:07 PM. |