in reply to Re: File and Word as Command Line arguments, Output # of Occurences
in thread File and Word as Command Line arguments, Output # of Occurences

Ahh brilliant, thanks for the tip on the common practice. So if I had a lot of arguments to pass in, shift moves from one to the next every time it is used?
  • Comment on Re^2: File and Word as Command Line arguments, Output # of Occurences

Replies are listed 'Best First'.
Re^3: File and Word as Command Line arguments, Output # of Occurences
by choroba (Cardinal) on Oct 28, 2015 at 00:52 UTC
    shift removes the first argument (or array element, if an array was specified) and returns it. The diamond operator iterates over the arguments as specified in I/O Operators.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ