New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running shell is wrong when called from script #3
Comments
I think you are right. Let me give it some thought probably next week I can spend an hour or two to address it. Any test for this can be skipped on OSes that don't have a /proc. |
So I have pushed out a dev version with this change as 0.02_01 on CPAN If it still looks good in a few days I will promote this to a regular release. Interestingly, with your particular example, I am still not getting bash:
when I stepped through in the debugger I was seeing this as the parent command line:
So I think bash must be doing an |
On CPAN as 0.03 |
You're probably right there; I was trying to compact a test case into a one-liner there, but perhaps I didn't test thoroughly enough. A more realistic test would be to create, say, a bash script like so:
and then run that script from, say, tcsh. IAE, your new version definitely fixes the issue, so thanx for the quick turnaround! |
If you call a Perl program using
Shell::Guess->running_shell
from inside a (say) bash script, it returns the shell of the command line used to launch the script as opposed tobash
. This is because the method used byrunning_shell
pulls the whole command line out of the file in the /proc system, but doesn't restrict what it looks at to arg 0.A simple command to demonstrate this:
That should really return
bash
. I'm not sure how to turn this into a useful test, however, since the test suite needs to run on all OSes.The patch is simple:
or I could turn that into a pull request if that's easier.
The text was updated successfully, but these errors were encountered: