Operating System - HP-UX
1758846 Members
2838 Online
108876 Solutions
New Discussion юеВ

how to run a shell directly in HP CDE, and exit immediately?

 
Zhe
Occasional Advisor

how to run a shell directly in HP CDE, and exit immediately?

I do NOT want a user get the login prompt,
run a shell instead.
but, the program need Xwindows environment,
i use exceed to satisfy it.
I set DTSOURCEPROFILE=true in .dtprofile and add exec nw.sh in .profile

Unfortunately I can NOT see the output of the shell, why?

Thanks in advance!
BRs,
Henry

while true
do

clear;
echo "\n\n\n\n\n\n"
echo " 1 --- nwadmin"
echo " 2 --- nwrecover"
echo " 3 --- exit"
echo "\n\\n\n"

read a
case $a in
1) /opt/networker/bin/nwadmin;;
2) /opt/networker/bin/nwrecover;;
3) exit;;
esac
done
exit
6 REPLIES 6
Steve Steel
Honored Contributor

Re: how to run a shell directly in HP CDE, and exit immediately?

Hi

Make your user a file named
.Xdefaults with 755 permissions

Insert line

*loginShell: true

Exit and reenter CDE and try again.

You will only see this when you open a window
dtterm or similar.

steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Maarten van Rossen
Occasional Advisor

Re: how to run a shell directly in HP CDE, and exit immediately?

Maybe you could do start a xterm from your .profile.

exec xterm -e nw.sh

Ofcourse you could also change the CDE enviroment so that there only a few buttons left. (for example one for exit one for nwadmin and one for nwrecover )


Hope this helps,

Maarten
Alex Glennie
Honored Contributor

Re: how to run a shell directly in HP CDE, and exit immediately?

why not bypass CDE if it's not needed ?

take a look at man xinit

The xinit program is used to start the X Window System server and a
first client program on systems that cannot start X directly from
/etc/init or in environments that use multiple window systems. When
this first client exits, xinit will kill the X server and then
terminate.If no specific client program is given on the command line, xinit will
look for a file in the user's home directory called .xinitrc to run as
a shell script to start up client programs. If no such file exists,
xinit will use the following as a default:

xterm -geometry +1+1 -n login -display :0


Zhe
Occasional Advisor

Re: how to run a shell directly in HP CDE, and exit immediately?

Thanks, Maarten.

It works greatly now. :)
Zhe
Occasional Advisor

Re: how to run a shell directly in HP CDE, and exit immediately?

Maarten,

Would you please tell me what the "-e" means?
exec xterm -e nw.sh

BRs,
Zhe
Pete Randall
Outstanding Contributor

Re: how to run a shell directly in HP CDE, and exit immediately?

The "-e" option tells xterm what to execute when it starts up - in this case, your nw.sh script.

HTH,
Pete

Pete