Operating System - HP-UX
1833523 Members
2962 Online
110061 Solutions
New Discussion

export DISPLAY Script help.

 
SOLVED
Go to solution
joe_91
Super Advisor

export DISPLAY Script help.

Team:

Please find attached the script where i am trying to validate first number should be 155 and if true then checks :0.0 and checks for a 2 digit value and sets the DISPLAY variable. Now this only works for two digit upto :99.0 but i need this to be working even for a four digit display like from :1.0 thru :1000.0. Please help me with this script.

Thanks
Joe.
2 REPLIES 2
joe_91
Super Advisor

Re: export DISPLAY Script help.

Team:

The attached script here..

Joe
Jordan Bean
Honored Contributor
Solution

Re: export DISPLAY Script help.


It should be sufficient to numerically evaluate the first IP octet as 155 and the screen number as greater than or equal to 10.

verify_DISPLAY () {
if [ ${1%%.*} -eq 155 -a ${1##*:} -ge 10 ]
then
return 0
fi
echo 'DISPLAY is NOT valid'
return 1
}