John J. Foster wrote:
> Good afternoon,
>
> In a bash script, how can I test whether the script itself is being
> run from a virtual terminal, or from an emulator like konsole within X?
>
> Thanks,
> festus
Hello,
Here is yet another approach.
So I would use the command "tty".
[EMAIL
John J. Foster wrote:
On Tue, Aug 01, 2006 at 03:43:12PM -0400, Philip Webb wrote:
060801 John J. Foster wrote:
In a bash script, how can I test whether the script itself is being run
from a virtual terminal, or from an emulator like konsole within X?
'echo $DISPLAY' returns ':0' from Konsole,
On Tue, Aug 01, 2006 at 11:37:17PM +0400, dg wrote:
> On Tuesday 01 August 2006 23:20, John J. Foster wrote:
>
> One possible solution would be to check the value of $TERM variable... If it
> is 'xterm' then you're probably in the X terminal emulator.
"probably" is not good ;-)
--
Ambition is a
On Tuesday 01 August 2006 23:20, John J. Foster wrote:
> Good afternoon,
>
> In a bash script, how can I test whether the script itself is being
> run from a virtual terminal, or from an emulator like konsole within X?
>
> Thanks,
> festus
Hi,
One possible solution would be to check the value of
On Tue, Aug 01, 2006 at 03:43:12PM -0400, Philip Webb wrote:
> 060801 John J. Foster wrote:
> > In a bash script, how can I test whether the script itself is being run
> > from a virtual terminal, or from an emulator like konsole within X?
>
> 'echo $DISPLAY' returns ':0' from Konsole,
> but nothi
El Martes, 1 de Agosto de 2006 21:20, John J. Foster escribió:
> Good afternoon,
>
> In a bash script, how can I test whether the script itself is being
> run from a virtual terminal, or from an emulator like konsole within X?
>
> Thanks,
> festus
If you need more concrete info, $TERM is also your
John writes:
> In a bash script, how can I test whether the script itself is being
> run from a virtual terminal, or from an emulator like konsole within X?
You can check the existance of the DISPLAY environment variable:
if [[ $DISPLAY ]]
then
echo "We're running under X"
else
e
060801 John J. Foster wrote:
> In a bash script, how can I test whether the script itself is being run
> from a virtual terminal, or from an emulator like konsole within X?
'echo $DISPLAY' returns ':0' from Konsole,
but nothing from a raw terminal called up via Ctl-Alt-F2 .
--
=
On 01 August 2006 20:20, John J. Foster wrote:
> Good afternoon,
>
> In a bash script, how can I test whether the script itself is being
> run from a virtual terminal, or from an emulator like konsole within X?
See this script by the name "strangename":
#! /bin/sh
ps ax | grep strangename
If r
Good afternoon,
In a bash script, how can I test whether the script itself is being
run from a virtual terminal, or from an emulator like konsole within X?
Thanks,
festus
--
Ambition is a poor excuse for not having enough sense to be lazy.
pgpGfTreHkh94.pgp
Description: PGP signature
10 matches
Mail list logo