On Mon, Mar 27, 2023 at 04:43:09PM -0700, L A Walsh wrote: > On 2023/03/27 13:28, Greg Wooledge wrote: > > You're calling filter_ssh with no arguments, but trying to use "$@" > > inside it to generate the ssh command. > Isn't "$@" still valid? Originally I didn't have func-filterssh, it was > inline.
Each function has its own private set of positional parameters ("$@" array) independent of the main script's "$@". If you want the funtion to see a copy of the script's arguments, you need to pass "$@" to it.