<br><br><div class="gmail_quote">On Tue, Apr 15, 2008 at 11:08 AM, Patrick O'Callaghan <<a href="mailto:pocallaghan@gmail.com">pocallaghan@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
On Tue, 2008-04-15 at 10:49 -0700, Don Russell wrote:<br>
> How can I tell, from a Korn shell script, if the script is running in<br>
> a vi sub-shell?<br>
><br>
> I have a script that has a problem when run from a vi subshell, and<br>
> I'd like to check for that condition and just issue an error message.<br>
> (I know that's not the solution to the problem, but the thing that<br>
> fails is being replaced, so this is a temporary "fix")<br>
<br>
</div>Try:<br>
<br>
ls -l /proc/`cat /proc/$$/status|grep PPid|cut -f2`/exe<br>
<br>
and work from there.</blockquote><div><br>That looks promising... thanks :-) <br></div></div>