Console/SSH/X: How to tell?

Dave Germiquet davegermiquet-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Fri Jun 19 19:54:33 UTC 2009


I'm wondering if you can use the $DISPLAY variable...

If the $DISPLAY variable is empty your in a shell.. if the $DISPLAY
variable has :0 or 0:0.1 you know you can open an xterminal window.

On Fri, Jun 19, 2009 at 3:36 PM, Marc Lanctot<lanctot-yfeSBMgouQgsA/PxXw9srA at public.gmane.org> wrote:
> Hello,
>
> I use pal for my calendaring now and I'd like my xterms to open up with
> the output from pal. However, if I add it to .bashrc, then when I try
> to copy things to/fro remotely scp fails because there is output
> generated by my .bashrc.
>
> So what I'd like to do is detect if the session is an xterm/console, or
> through interactive ssh.. and output the calendar in these cases but
> not in cases where I scp or execute a command remotely.
>
> Can I do this? If so, how?
>
> Thanks in advance,
> Marc
>
> --
> Any code of your own that you haven't looked at for six or more months
> might as well have been written by someone else.
>  -- Eagleson's law
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>



-- 



Dave Germiquet
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list