title: Bash skipping iteration in for
body: <p>I have to write an macro that gets few arguments to it. for example ./macro.sh -wrongone -f filename -wrongone.
  I have to catch the wrong ones and list them and make required operation on the valid ones. Here is my code:</p>
  
  <pre><code>for i in "${ArrayOfParameters[@]}"
  do
      tmp=$[tmp+1]
      case "${i}" in
  
      "-h" | "--help")
          help
          ;;
  
      "-f")   
          a="${ArrayOfParameters[i+1]}"
          echo $a
          i=$[i+1]            
          ;;          
  
      *)
          echo -e "${red}Parameter ${i} is wrong!${NC}"
          ;;
      esac
  
  done    
  </code></pre>
  
  <p>My problem is that I do not know how to make 'filename' to be skipped by default operation of the switch :(. Every time I get error that filename is wrong parameter. I was thinking about skipping one iteration. Something like that in C++.</p>
  
  <pre><code>for(int i=0;i&lt;5;i++)
  if(i==3)
  i=4;
  </code></pre>
  
  <p>I would like to get something like that in Bash but no idea how to do it.
  Tried</p>
  
  <pre><code>for (( i=0; i&lt;=5; i++ ))
  a="${ArrayOfParameters[i]}"
  </code></pre>
  
  <p>but it was returning me all the time numbers not the strings.
  I would be really gratefull for helpfull answers.</p>