Connecting Tech Pros Worldwide Help | Site Map

Dealing with options , Shell scripting :

Member
 
Join Date: Apr 2008
Location: United states
Posts: 123
#1: Jan 8 '09
Hi all,
I am a newbie in shell scripting..
I am writing a code to automate the installation of some softwares.
It includes some of the question during installation where we need to choose from that. How can I automate that part.
e.g if the screen size menu pops up, my script should select the maximized option always and thus fully automating the installation
I am not quite sure if there is any method or function.

Thanks
gpraghuram's Avatar
Expert
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,256
#2: Jan 8 '09

re: Dealing with options , Shell scripting :


I am not clear with your requirement.
Do u want to use the previously enetered values or u need something else?

Raghu
ashitpro's Avatar
Expert
 
Join Date: Aug 2007
Posts: 389
#3: Jan 8 '09

re: Dealing with options , Shell scripting :


Quote:

Originally Posted by ajd335 View Post

Hi all,
I am a newbie in shell scripting..
I am writing a code to automate the installation of some softwares.
It includes some of the question during installation where we need to choose from that. How can I automate that part.
e.g if the screen size menu pops up, my script should select the maximized option always and thus fully automating the installation
I am not quite sure if there is any method or function.

Thanks

I've always suggested to use "expect" utility to automate the things in shell script...
Member
 
Join Date: Apr 2008
Location: United states
Posts: 123
#4: Jan 8 '09

re: Dealing with options , Shell scripting :


Quote:

Originally Posted by gpraghuram View Post

I am not clear with your requirement.
Do u want to use the previously enetered values or u need something else?

Raghu

Hi Raghuram,
I already have the desired value for the options to be checked and not to be checked. E.g If window size option pops up , I always wanted to select maximize from that.( i.e Window size option will have 2 values only maximized and minimized . Further I have the information regarding all option : all the options with their sequence. )
So I just need to have some way so that I can automate the process giving the desired value for each options.
( You can think above as e.g you are installing a software for the 3rd time, so you know which option will pop up after which and what will be the options and what you want to select).....

Thanks...
Member
 
Join Date: Apr 2008
Location: United states
Posts: 123
#5: Jan 8 '09

re: Dealing with options , Shell scripting :


Quote:

Originally Posted by ashitpro View Post

I've always suggested to use "expect" utility to automate the things in shell script...

Hi,
Thanks for the suggestion.
I searched on Google about Expect. Found very helpful.
Actually my OS installation ask me various questions.
When I ran a command to install one utility, it will pop up a window having different values and have check boxes to select them.
I have decided on the options I wanted to check.
Can you please tell me how can I do so.

E.g The mail/postfix utility will popup a window having several check and unchecked boxes.
I want to select particular two options and uncheck one...
Can you please provide me some sample formate for doing so?
Thanks for your help.
Member
 
Join Date: Apr 2008
Location: United states
Posts: 123
#6: Jan 8 '09

re: Dealing with options , Shell scripting :


Further, is there any other way than using "expect". As I am writing a script to automatically install all the system tools and utility and thus /usr/ports/lang/expect is not installed(Infact the script is installing all the ports and so on)... So is there any other way than expect or else some way to use expect if not have the /usr/ports/lang/expect ??

Thanks for helping me up............
gpraghuram's Avatar
Expert
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,256
#7: Jan 9 '09

re: Dealing with options , Shell scripting :


So you dont want to ask the user certain inputs and automate it?
If yes then its easy right as you said you have all the values with you.

Raghu
Member
 
Join Date: Apr 2008
Location: United states
Posts: 123
#8: Jan 9 '09

re: Dealing with options , Shell scripting :


Quote:

Originally Posted by gpraghuram View Post

So you dont want to ask the user certain inputs and automate it?
If yes then its easy right as you said you have all the values with you.

Raghu

Hi Raghu,
Yes I am aware of what questions will be there and the answers . But, how to so so. I cannot use EXPECT , because my script is going to install /usr/ports. I am not aware of the function or the utility which can help me in this. Can you please tell me what can be done ?

Thanks for the help..
Reply