Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not sure if I'm asking that right, but here is the script:

# foundation-setup.sh --- Gets the latest Zurb Foundation release
if test $1
    mkdir $* 
    cd $* 
    wget -q http://foundation.zurb.com/cdn/releases/foundation-latest.zip
    unzip -q foundation-latest.zip
    rm foundation-latest.zip
       echo 'Missing directory Argument!'

When I run this with ./foundation-setup.sh a b c, it works but it only unzips to the first directory argument. I think it has something to do with the cd $* . By the way I'm new to Linux and Bash.

share|improve this question
up vote 5 down vote accepted

If you want to extract the downloaded zip in each of the three directories the middle part of the script should be:

mkdir -- "$@" || exit 
wget -q http://foundation.zurb.com/cdn/releases/foundation-latest.zip &&
  for d do
       cd -- "$d" &&
         unzip -q ../foundation-latest.zip
  done &&
  rm foundation-latest.zip
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.