Re: [OT] how can a bash script determine if it's running in an xterm???

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


>  Jul  7 Steven W. Orr        (3098) Re: [OT] how can a bash script determin
>  Jul  7 Jeff Vian            (3145) Re: [OT] how can a bash script determin
>  Jul  7 Robert P. J. Day     (2103) Re: [OT] how can a bash script determin
>  Jul  8 Nifty Hat Mitch      (3759) Re: [OT] how can a bash script determin



Thanks guys, I appreciate the help. Actually though Somebody sent me an
test script off list that does a good job of demonstrating how a bash script
can check for all three conditions, AND points at the wealth of info
that can be extracted with env. I wanted to offer a big Thank you but I
seam to have lost the e-mail... Sigh!

I know I had it, as I copied the script from it. And I don't remember
deleting that E-mail message but I can't find it.

So to you who sent me a script something like this. (you know who you
are...) THANKS!


>> #!/bin/bash
>> 
>> if ! tty -s
>> then
>>         echo "Running non-interactive.." > ~/wai
>> elif test ! -z $DISPLAY
>> then
>>         echo "Running in GUI" > ~/wai
>> else
>>         echo "Running on console" > ~/wai
>> fi
>> echo '___________' >> ~/wai
>> env >> ~/wai


- -- 
|   ---   ___
|   <0>   <->	   Joe (theWordy) Philbrook
|	^		J(tWdy)P
|    ~\___/~	     <<jtwdyp@xxxxxxxx>>

   ##############################################################
   # You can find my public gpg key at http://pgpkeys.mit.edu/  #
   ##############################################################

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA70orRZ/61mwhY94RAk4AAJ9poRtrONnRWSifRWoHFZjfxCPJ6QCgkAPp
OGHCmUqIe156NG4Qb/MonyQ=
=hA5q
-----END PGP SIGNATURE-----



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux