List Info

Thread: Determine session type?




Determine session type?
user name
2006-11-30 15:59:15
Hello,

   I have a script which I use to edit encrypted files. It
simply
decrypts the file onto /tmp/, starts "vi" against
the decrypted file,
then - when I quit the editor - it encrypts the file again.

   But I'd like it to start "nedit" instead *if*
I'm running under X. I
assume this is possible? If so -- how?

-- 
Kind regards,
Jan Danielsson


Determine session type?
user name
2006-11-30 16:29:09
On 11/30/06, Jan Danielsson <jan.m.danielssongmail.com> wrote:
> Hello,
>
>    I have a script which I use to edit encrypted files.
It simply
> decrypts the file onto /tmp/, starts "vi"
against the decrypted file,
> then - when I quit the editor - it encrypts the file
again.
>
>    But I'd like it to start "nedit" instead
*if* I'm running under X. I
> assume this is possible? If so -- how?

Shamelessly modified gftp script:

#!/bin/sh

prefix=/usr/pkg
exec_prefix=$

if [ "$DISPLAY " != " " ] && [
-f $/bin/nedit ]; then
        exec $/bin/nedit ${1+"$"}
else
        exec /usr/bin/vi ${1+"$"}
fi

>
> --
> Kind regards,
> Jan Danielsson
>
>
>
>
>

Chavdar
Determine session type?
user name
2006-11-30 16:30:48
Just check if the DISPLAY variable is set?

	Johnny

Jan Danielsson wrote:
> Hello,
> 
>    I have a script which I use to edit encrypted files.
It simply
> decrypts the file onto /tmp/, starts "vi"
against the decrypted file,
> then - when I quit the editor - it encrypts the file
again.
> 
>    But I'd like it to start "nedit" instead
*if* I'm running under X. I
> assume this is possible? If so -- how?
> 
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )