[SunHELP] $DISPLAY for root
David Ledger
sunhelp at sunhelp.org
Fri Aug 17 02:31:24 CDT 2001
The snippet is for ksh or a posix sh which should both understand
'$(<command>)' and '$((<arith-expr>))'
a Bourne or csh will give that error.
I did cut & paste from a working ksh script. It could be translated
to csh, but not by me. Havn't used it for nearly 15 years.
David
>From: "David Baldwin" <dbaldwin at networkinsight.com>
>
>I threw that snip in my /etc/profile but when I ". /etc/profile" I get a
>syntax error. ( is unexpected. I checked that they all match up
>properly but I can't find where the problem is. I am working on my
>shell scripting but I am by no means good at it. Is there something
>else that needs to happen first?
>
>Thanks for all the help
>Dave Baldwin
>
>
>
>-----Original Message-----
>From: David Ledger [mailto:dledger at ivdcs.demon.co.uk]=20
>Sent: Thursday, August 16, 2001 6:56 AM
>To: sunhelp at sunhelp.org
>Subject: RE: [SunHELP] $DISPLAY for root
>
># Set the DISPLAY global environment variable.
> if [ ! "$DISPLAY" ]; then
> set -A DISPLAY $(who -um)
> DISPLAY=3D${DISPLAY[$((${#DISPLAY[*]} - 1))]}
> DISPLAY=3D${DISPLAY%:0.0}:0.0
> export DISPLAY
In a 'sh' derived shell you '.' for source, as David did. 'source'
is csh speak.
>From: Ben Ricker <bricker at wellinx.com>
>
>You do not execute a .profile, you use the command 'source'. Read up on
>man source.
--
David Ledger - Freelance Unix Sysadmin in the UK.
Chair of SysAdmin SIG of HP/Works technical user group
dledger at ivdcs.co.uk (also dledger at ivdcs.demon.co.uk)
www.ivdcs.co.uk
More information about the SunHELP
mailing list