Create variables for unknown amount of arguments?

Posted by user347600 on Stack Overflow See other posts from Stack Overflow or by user347600
Published on 2010-05-22T02:01:41Z Indexed on 2010/05/22 2:10 UTC
Read the original article Hit count: 171

Filed under:

Working on an rsync script and the portion below is in a for loop. What I want to achieve is assign a variable to every arguement after 3. Just confused if I need to create another loop for that or not:

#1: name
  name=$1

  #2: ip 
  ip=$2

  #3: user
  user=$3

  #4+: folder exlusion
  #any lines higher than 3 will be created as exlcude folders
  ex[ARG_NUMBER]=

© Stack Overflow or respective owner

Related posts about bash