1846122 Members
5005 Online
110254 Solutions
New Discussion

Scripting question

 
John Ramsay_2
Regular Advisor

Scripting question

Could someone answer a script question?
7 REPLIES 7
Karthik S S
Honored Contributor

Re: Scripting question

Pl. post the question first :-))

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
James A. Donovan
Honored Contributor

Re: Scripting question

yes. ;-)
Remember, wherever you go, there you are...
John Ramsay_2
Regular Advisor

Re: Scripting question

I have CDE, Gnome and WindowMaker all installed and can run any of the three from comand prompt. Is there a way to write a script like:
wn = xinit /usr/local/bin/wmaker
or
gnome = xinit /etc/gnome/gdm/Sessions/Gnome
or
cde = xinit /usr/dt/bin/Xsession
Kind of like the old batch files .bat in MS DOS (remember that?) :)
James A. Donovan
Honored Contributor

Re: Scripting question

You can create aliases for your commands. If you use the ksh, add these lines to your .profile file...


alias wn='xinit /usr/local/bin/wmaker'
alias gnome='xinit /etc/gnome/gdm/Sessions/Gnome'
alias cde='xinit /usr/dt/bin/Xsession'
Remember, wherever you go, there you are...
Karthik S S
Honored Contributor

Re: Scripting question

I have answered to your other post on this,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=306906


-----------------------

##Run this script as "script cde/wm/gnome"
case $1 in
cde) xinit /usr/dt/bin/Xsession
;;
wm) xinit /usr/local/bin/wmaker
;;
gnome) xinit /etc/gnome/gdm/Sessions/Gnome
;;
esac

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
John Ramsay_2
Regular Advisor

Re: Scripting question

Kartnik,
I could not do anything with your reply because it looks like alien writing. (Not everyone is as knowledgible as you).

Jim,
/.profile shows up in the file manager but when I click on it it says file does not exist. I also have /etc/skel/.profile andtwo under /user/newconfig...
How do I add these aliases.
I'm using sh
#
Karthik S S
Honored Contributor

Re: Scripting question

As knowledgible as me :-)) ... OK I will take this as a Joke ...

Under /usr/bin create a file named "runx" using "vi" and the file should contain the following entries,

#----------------------------------------
##Run this script as "runx cde/wm/gnome"
case $1 in
cde) xinit /usr/dt/bin/Xsession
;;
wm) xinit /usr/local/bin/wmaker
;;
gnome) xinit /etc/gnome/gdm/Sessions/Gnome
;;
esac
#----------------------------------------

Then do a,
chmod 555 /usr/bin/runx

Now if you want to start gnome,
/usr/bin/runx gnome

For CDE
/usr/bin/runx cde

For Window Manager
/usr/bin/runx wm

-Karthik S S

For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn