How do I format in a script the number of arguments passed through a bash script? This what I have currently that works:
#!/bin/bash
echo "$# parameters"
echo "$@"
But I wanted to format is using a function but everytime I run it, it comes back as 0 parameters:
#!/bin/bash
example()
{
echo "$# parameters"; echo "$@";
}
example
Am I thinking about this incorrectly?