I have some
.sh bash scripts which creates some directories, downloads some sourcefiles via SVN and so on.
The scripts works every well, but it annoys me that they are performing the action in
filesystem/*, not in
wwww. If they create a directory like
/data, it is created as
I have tried running the scripts from within subdirectories, eg
but all the action is still performed in
filesystem/*. I have also tried running with
./, no luck.
I am always able to copy the generated file structure from
www, but I would really like to know how I can force bash to execute where it is.
There is no hardcoded links pointing to filesystem, one of the .sh files looks like this
#!/bin/sh cd / mkdir data cd /data svn checkout <path to svn> mb32 cd mb32 mv www/htaccess.txt www/.htaccess INSTALL_PATH=`pwd` INSTALL_PATH=$INSTALL_PATH"/" to_replace="#php_value auto_prepend_file" replace_by="php_value auto_prepend_file" eval sed -i \'s/$to_replace/$replace_by/\' www/.htaccess to_replace="/my/root/path/" replace_by=$INSTALL_PATH args="-i 's|$to_replace|$replace_by|' www/.htaccess" eval sed $args cp www/.htaccess ImageServer/ eval sed -i 's/app.server.php/image.server.php/g' ImageServer/.htaccess echo "Changing permissions to configuration and log..." sudo chmod -R 775 configuration sudo chmod -R 775 log echo "Done"
When it is runned from terminal, for example from
www/a/test, it insists to create
filesystem/data and download to
filesystem/data/mb32. I would like it to download to
www/install/data etc. I am obviously missing some very simple and basic.