This is the situation. I have a list of URLs that I need to extract and configure. Its all variables are controlled, but after I extracted it, I don’t know how my folder will be called. I can’t burn a CD if I don’t know what his name is.
$DL_DIR = /opt/
$URL = http://nginx.org/download/nginx-1.3.3.tar.gz
$FILE=${URL##*/}
$CONFIG = "-- core"
cd "$DL_DIR"
wget $URL
tar xzf $FILE
cd <HOW DO I GO INTO IT?>
./configure "$CONFIG"
make
make install
rm $FILE
If this does not explain it, tell me. I really want to overcome this problem, but it's hard for me to explain it.
Since I want this to work for any set of URLs that can have two formats like ".tar.gz" or one format ".zip" and can have. in the file name, for example "Python2.3.4" or cannot "Nginx", this is a bit complicated.
source
share