From nobody Thu Jun 08 10:34:11 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcLDg3VPFz4bKVj for ; Thu, 8 Jun 2023 10:34:27 +0000 (UTC) (envelope-from serejk@febras.net) Received: from prima.febras.net (prima.febras.net [62.76.193.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "*.febras.net", Issuer "AlphaSSL CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcLDf5cdWz3vXP for ; Thu, 8 Jun 2023 10:34:26 +0000 (UTC) (envelope-from serejk@febras.net) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (host.164-138-91-83.broadband.redcom.ru [164.138.91.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: serejk@febras.net) by prima.febras.net ("FEB RAS network Mail Server") with ESMTPSA id F3FA255B900; Thu, 8 Jun 2023 20:34:12 +1000 (VLAT) From: Korolev Sergey Message-Id: <5F4B47E8-E3A0-479D-B0E1-732AFBB659E0@febras.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_DB6C3D00-C26D-4F71-A126-99EE6EA0B73A" List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: Check if running inside script Date: Thu, 8 Jun 2023 20:34:11 +1000 In-Reply-To: Cc: questions@freebsd.org To: Yuri References: <6b3f5a7f-e0cb-bb6f-38d5-050348d76387@netfence.it> X-Mailer: Apple Mail (2.3654.120.0.1.15) X-FEBRAS-Info: Contact e-mail: admin@febras.net X-FEBRAS-ID: F3FA255B900.A5EA6 X-FEBRAS: clean X-FEBRAS-SpamCheck: not spam, SpamAssassin (not cached, score=-1.338, required 5, ALL_TRUSTED -1.00, AWL -1.34, BAYES_50 0.80, HTML_MESSAGE 0.00, MR_NOT_ATTRIBUTED_IP 0.20, URIBL_BLOCKED 0.00) X-FEBRAS-From: serejk@febras.net X-FEBRAS-To: questions@freebsd.org, yuri@aetern.org X-Spam-Status: No X-Rspamd-Queue-Id: 4QcLDf5cdWz3vXP X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:34017, ipnet:62.76.193.0/24, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_DB6C3D00-C26D-4F71-A126-99EE6EA0B73A Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii echo $TERM > On 8 Jun 2023, at 20:16, Yuri wrote: > > Andrea Venturoli wrote: >> Hello. >> >> Is there a way a shell script of mine can check if running inside >> sysutils/screen? > > Answers on stackexchange (I'm using tmux so didn't check) mention that > screen sets STY env var, check it. > --Apple-Mail=_DB6C3D00-C26D-4F71-A126-99EE6EA0B73A Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii echo $TERM

On 8 Jun 2023, at 20:16, Yuri <yuri@aetern.org> wrote:

Andrea Venturoli wrote:
Hello.

Is there a way a shell script of mine can check if running inside
sysutils/screen?

Answers on stackexchange (I'm using tmux so didn't check) mention that
screen sets STY env var, check it.


--Apple-Mail=_DB6C3D00-C26D-4F71-A126-99EE6EA0B73A--