unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Puff Addison <puff@transport.ucl.ac.uk>
Subject: Re: test -t can distinguish compile sessions
Date: Tue, 17 Jun 2003 10:34:38 +0100	[thread overview]
Message-ID: <bcmnd5$i86$1@uns-a.ucl.ac.uk> (raw)
In-Reply-To: <jyqHa.2671$3Q7.719@news.cpqcorp.net>

Robert Hundt wrote:
> 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" <jidanni@jidanni.org> wrote in message
> news:8765nc2i6n.fsf@jidanni.org...
> 
>>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
> 
> 
> 
The tty command does this:
try
$ tty
and
$ cat | tty
^D

	Puff Addison

      reply	other threads:[~2003-06-17  9:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-14  4:19 test -t can distinguish compile sessions Dan Jacobson
2003-06-16 21:22 ` Robert Hundt
2003-06-17  9:34   ` Puff Addison [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='bcmnd5$i86$1@uns-a.ucl.ac.uk' \
    --to=puff@transport.ucl.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).