![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
|
||||
|
Quote:
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 | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|