in order to parse the arguments list I tried to implement a common top-down parsing scheme.
I wondered why my eat()
function wouldn't work. Because the positional arguments $1, $2, $3, ... are in the context of that particular function. Not the ones of the actual script. Bummer. I'm didn't yet grow accustomed to bash.
So my question is, if it is therefore correct, that also the scope of shift is the context of my eat()
function, yes?
Is there really no way of shifting the script arguments from inside another function? : (
[That means I have to implement ALL logic (that normally adheres to a top down parsers') in a case statement ! (!?)]
getopts
? There is no indication as to how you call your script or youreat
function within it, nor what the script or function needs in terms of parameters, or what their function is. – Kusalananda Jun 03 '21 at 07:13eat
function work on that, to set myshove all the option processing into its own function
scheme into motion. :) – von spotz Jun 03 '21 at 07:54