jtojnar / nixpkgs-hammering

Beat your package expressions into a shape
MIT License
245 stars 14 forks source link

If an embedded function inside a bash alias is valid, it is not being checked properly #125

Closed pasha-19 closed 2 years ago

pasha-19 commented 2 years ago

PLEASE DELETE THIS it appears to be in the WRONG PLACE, Sorry

alias    aEcho='f() { echo "+:'"${BASH_SOURCE[0]}"':'"${FUNCNAME[0]}"':'"${LINENO[0]}"':     ${1}"; unset -f f; }; f '

The above syntax appears to be valid and the following appears to work. shellcheck flags this for invalid use of arguments when the arguments are used in an embedded (temporary) function. it also flags the named bash variables for expanding at the wrong time. They appear to expand when the function is loaded with what appear to be very close to valid values for my purposes. Escaping the assignment to get a value when the function runs could eliminate the getting of the location where the alias is coded. Thanks for allowing me to enter this. If it is invalid then please disregard. I am a relatively new bash coder.

aEcho "Hello World" 
pasha-19 commented 2 years ago

Sorry in wrong place.