I agree. (
http://catb.org/~esr/faqs/smart-questions.html#beprecise )
Of course it would help if the OP told us what it was that he wanted to
*actually do*. (
http://catb.org/~esr/faqs/smart-questions.html#goal ).
Then tell us what the actual restrictions are. For example why does it
*have* to be run as ". ./test.sh", rather than say ". ./test.sh ./
test.sh"?
Is it allowed to alter the test.sh script or not?
Is it allowed to change the meaning of the "." command?
Is it being run from an interactive shell, so we might be able to use
"history 0 0" to get the command, or is it being run from a script?
Can we set up a function to run the command?
Frequently the reason for using "." is to change the current environment
in some way, could we use have the script output the changes and then use
"eval"? Maybe we could use a couple of "exec" statements to replace the
current environment first with the script and then with a replacement
interactive shell.