Dica válida para quem tem o SO da base SAP no linux e precisa sempre ficar setando a variavel DISPLAY
caso o bash do usuário seja o .CSH
#
# Set DISPLAY
#
if ( ! $?DISPLAY ) then
set TTYPORT=`tty`
if ( $TTYPORT == /dev/console ) then
setenv DISPLAY "localhost:0"
else if ( $?REMOTEHOST ) then
setenv DISPLAY "${REMOTEHOST}:0"
else
set TTYNAME=`echo $TTYPORT |cut -c6-`
set REMOTEHOST=`who|grep "$TTYNAME"|awk '{print $6}'|sed 's/(//'
|sed 's/)//'`
setenv DISPLAY "${REMOTEHOST}:0"
endif
endif
# Set DISPLAY
#
if ( ! $?DISPLAY ) then
set TTYPORT=`tty`
if ( $TTYPORT == /dev/console ) then
setenv DISPLAY "localhost:0"
else if ( $?REMOTEHOST ) then
setenv DISPLAY "${REMOTEHOST}:0"
else
set TTYNAME=`echo $TTYPORT |cut -c6-`
set REMOTEHOST=`who|grep "$TTYNAME"|awk '{print $6}'|sed 's/(//'
|sed 's/)//'`
setenv DISPLAY "${REMOTEHOST}:0"
endif
endif
caso o bash do usuário seja o .bashrc
#
# Set the DISPLAY
#
if [ x"$DISPLAY" = x ]
then
TTYPORT=`tty`
if [ "$TTYPORT" = "/dev/console" ]
then
DISPLAY="localhost:0"
elif [ "$REMOTEHOST" = "" ]
then
TTYNAME=`echo $TTYPORT | cut -c6-`
REMOTEHOST=`who|grep "$TTYNAME"|awk '{print $5}'|sed 's/(//'|sed 's/)//'`
DISPLAY="${REMOTEHOST}:0"
else
DISPLAY="${REMOTEHOST}:0"
fi
fi
# Set the DISPLAY
#
if [ x"$DISPLAY" = x ]
then
TTYPORT=`tty`
if [ "$TTYPORT" = "/dev/console" ]
then
DISPLAY="localhost:0"
elif [ "$REMOTEHOST" = "" ]
then
TTYNAME=`echo $TTYPORT | cut -c6-`
REMOTEHOST=`who|grep "$TTYNAME"|awk '{print $5}'|sed 's/(//'|sed 's/)//'`
DISPLAY="${REMOTEHOST}:0"
else
DISPLAY="${REMOTEHOST}:0"
fi
fi
Como verificar qual o bash do usuário
vi /etc/passwd
sapadm:x:509:500::/home/sapadm:/bin/csh = .CSH
sapsmdpecadm:x:504:500::/home/sapsmdpecadm:/bin/bash = .bashrc
sapsmdpecadm:x:504:500::/home/sapsmdpecadm:/bin/bash = .bashrc