I'm not following the request here. Why do you need to use eval
? Why doesn't $LINENO expand on its own?
Is it because you're trying to call the function this way?
fatal='eval _fatal $LINENO'
Shouldn't you be using this instead?
fatal=$( _fatal "$LINENO" )
...which captures the stdout of the _fatal
function into the variable $fatal
How about giving us some more context, and the actual contents of the function, so we can more easily know what you're trying to do?
(As an additional point, having both a variable and a function with almost the same name is rather confusing. )