The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with solaris 10 installation package MasterapocA SUN Solaris 12 07-03-2008 01:49 PM
Package Installation HELP! liketheshell UNIX for Advanced & Expert Users 1 03-07-2008 03:40 PM
Solaris Package Installation sdspawankumar SUN Solaris 1 01-30-2008 11:27 AM
Silent package installation swinstall swask mendocino HP-UX 0 03-08-2006 09:31 PM
package from shell script run_time_error Shell Programming and Scripting 1 04-18-2005 02:47 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-03-2008
muhilan.r muhilan.r is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 2
Shell Script to Automate Package Installation

Hi,
I have been asked to automate the package installation through shell script.
I have 10 packages to be installed and in that 4 packages requires additional DB information(Host Name, Credentials etc) to be passed and for remaining 6 packages i need to provide the "Yes" - "No" .
I have tried with expect , admin file but as per my understanding both requires standard input/steps to defined. Can i use expect with If loop after spawning the command
say f or ex : Spawn pkgadd "Test.pkg"
if (expect [Host Name])
then
send "HOST NAME"
Is it possible to validate the outcome of the command and input the option through shell script? Please Clarify. or Do we have any other approach to perform this?

Thanks,
Muhil
  #2 (permalink)  
Old 10-03-2008
muhilan.r muhilan.r is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 2
Automating Package Installation through ShellScript

posted in 2 forums

Last edited by muhilan.r; 10-03-2008 at 07:13 AM..
  #3 (permalink)  
Old 11-04-2008
igorc igorc is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 7
Quote:
Originally Posted by muhilan.r View Post
Hi,
I have been asked to automate the package installation through shell script.
I have 10 packages to be installed and in that 4 packages requires additional DB information(Host Name, Credentials etc) to be passed and for remaining 6 packages i need to provide the "Yes" - "No" .
I have tried with expect , admin file but as per my understanding both requires standard input/steps to defined. Can i use expect with If loop after spawning the command
say f or ex : Spawn pkgadd "Test.pkg"
if (expect [Host Name])
then
send "HOST NAME"
Is it possible to validate the outcome of the command and input the option through shell script? Please Clarify. or Do we have any other approach to perform this?

Thanks,
Muhil

Have a look at this code snippet from one of my scripts doing automating SFTP:

/usr/bin/expect <<EOF
spawn /usr/bin/sftp USERNAME@SERVER_IP
expect {
"Password: " {
send "PASSWORD\r"
}
"Are you sure you want to continue connecting (yes/no)? " {
send "yes\n"
expect "Password: "
send "PASSWORD\r"
}
}
expect "sftp> "
send "cd $IMEIS \r"
expect "sftp> "
send "lcd $LOCALDIR \r"
expect "sftp> "
send "get $file \r"
expect "sftp> "
send "bye \r"
EOF


You should be able to change it to your like.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0