title: How to get each folder in the current directory and iterate it into a script
body: <p>I'm making a backup script to zip up files and ftp them to a windows server. What I have now works, but it requires an argument for each folder I want to backup individually when I execute it. /path/ may contain many folders that I want to backup and I'd like to automate this script to get each folder in /path/ and back them up into their own .zip by running the script one time. Can anyone offer any insight into how to do this? Or at least how I can get each directory and iterate though?</p>
  
  <pre><code>#!/bin/sh
  HOST='x.x.x.x'
  USER='user'
  PASSWD='pass'
  now=$(date +"%m_%d_%Y")
  cd /path/
  PROC=$1
  DIR="$PROC"
  FILE="$PROC"."$now.zip"
  echo $FILE
  zip -r $FILE $DIR
  ftp -n $HOST &lt;&lt;END_SCRIPT
  quote USER $USER
  quote PASS $PASSWD
  binary
  mkdir $PROC
  cd $PROC
  put $FILE
  quit
  END_SCRIPT
  #exit 0
  ~
  </code></pre>