If I call to the some function in bash , for example: func ${a} so exists way so that I will know what is the name of the variable that i passed with it the value to the function? (in this case: a)?
I know that it's not makes sense (because we can also call to this function without variable, for example: func blabla but my question is if exists way to know what is the name of the variable that passed (if the value passed via variable).
My problem is that i have function that in some places in the code exists calls to this function in some versions (this function without strictly API and i can't change it). And now I want to use this function with only one argument (that in the another calls "the first argument" might be another thing) so i want to analyze in this function if I am in this case that i work about or not (so i thought about this way, that I will check in the function via which variable the value passed).
For examples, in some places exists the following calls to this function:
a=`func 1 3`
b=`func`
But basically, until now, func did not get input (according to the API of this function) , but i does not want to touch this places. but, i want pass only one argument to this function and that the function func will work in accordance (and to know how to ignore the calls above - while the input is not really valid input).
and in func i want to use $1 only in the case that it's valid input and not in the dirty cases that uses this function (in this cases i want to ignore the input)