Bash scripting: Arguments to script
I'm a noob a bash scripting and want to write a script where the number of arguments (i.e. $ script.sh arg1 arg2 arg 3... etc.) varies.
Is there any easy way to do this?
The arguments will later be used in the script and should have individual names (but that shouldn't be a problem, i.e. @1, @2, @3 etc.).
Furthermore is there a simple way to count the number of arguments? I could of course make a for loop or something, but it would be great if there was an actual function.
Thank you!
|