Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

# --- Gets the latest Zurb Foundation release
if test $1
    mkdir $* 
    cd $* 
    wget -q
    unzip -q
       echo 'Missing directory Argument!'

When I run this with ./ 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

1 Answer 1

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 &&
  for d do
       cd -- "$d" &&
         unzip -q ../
  done &&
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.