Name: Als 2005-04-21 7:35
Hi guys and gals.
Could someone offer a little help to this annoying UNIX problem please? Ok, I gotta make a little script that jumps to a directory held in the environmental variables i.e
$ ./alsascript mypics
would take me to $HOME/pics kinda thing. so i made this code:
#!/bin/bash
set -a
_webspace=$HOME/public_html/
_powerpoint=$HOME/public_html/pp
_databases=$HOME/public_html/
_spreadheets=$HOME/public_html/
set +a
if [ -z "$1" ];
then echo argument is blank
else
eval cd $"$1" <<<<<<<<< ARGH!
echo New working directory is:
pwd
Now, when i run it from BASH and put say... ./alsascript powerpoint it says "powerpoint" is not a directory. But if i change that line where i put ARGH! to eval cd $_powerpoint or any of the other variables it works so i assume the syntax on that line is wrong but i can't find anywhere what it should be. Any ideas to make it work? Thank you in advance!
Could someone offer a little help to this annoying UNIX problem please? Ok, I gotta make a little script that jumps to a directory held in the environmental variables i.e
$ ./alsascript mypics
would take me to $HOME/pics kinda thing. so i made this code:
#!/bin/bash
set -a
_webspace=$HOME/public_html/
_powerpoint=$HOME/public_html/pp
_databases=$HOME/public_html/
_spreadheets=$HOME/public_html/
set +a
if [ -z "$1" ];
then echo argument is blank
else
eval cd $"$1" <<<<<<<<< ARGH!
echo New working directory is:
pwd
Now, when i run it from BASH and put say... ./alsascript powerpoint it says "powerpoint" is not a directory. But if i change that line where i put ARGH! to eval cd $_powerpoint or any of the other variables it works so i assume the syntax on that line is wrong but i can't find anywhere what it should be. Any ideas to make it work? Thank you in advance!