help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test -t can distinguish compile sessions


From: Robert Hundt
Subject: Re: test -t can distinguish compile sessions
Date: Mon, 16 Jun 2003 21:22:23 GMT

Hey Dan,

I guess you would have to check the process tree (via ps -ef) and see
whether emacs is somwhere the parent of your current shell.

For example (on HP-UX, needs adjustment for your shell):

ps -ef | grep `ps -ef | grep $$ | grep ksh | grep -v grep | awk '{ print
$3 }' ` >out
cat out | grep -v /ksh | grep -v grep | grep /emacs
if [[ $? = 0 ]] then
   echo "We are emacs"
fi

-- Robert

"Dan Jacobson" <address@hidden> wrote in message
news:address@hidden
> How can a shell script tell that we can't talk back, i.e. we are
> either in a batch job or a emacs compile session? test -t doesn't
> catch the latter, nor does test -t 0. case $- in *i*) isn't too
> helpful either.  No, don't tell me how to talk back during compile
> sessions, just tell me how to test...
> --
> http://jidanni.org/ Taiwan(04)25854780




reply via email to

[Prev in Thread] Current Thread [Next in Thread]