Sponsored Content
Top Forums Shell Programming and Scripting Use expect to run an interactive shell script? Post 302629393 by brianjb on Tuesday 24th of April 2012 03:16:07 PM
Old 04-24-2012
No, do this....

Code:
#!/usr/bin/bash 
echo -n "Enter the number 1 to install then press  [ENTER]: " 
read INSTALL  
if [ $INSTALL = 1 ] 
then 
sh /tmp/symantecuninstall.sh 
else 
echo "Not installing" 
fi

And if you don't care about providing feedback, you can do:

Code:
#!/usr/bin/bash
 echo -n "Enter the number 1 to install then press  [ENTER]: " 
read INSTALL  
if [ $INSTALL = 1 ] 
then 
sh /tmp/symantecuninstall.sh 
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Run expect script in systems that don't support it out of box

Noob question .. My Java based application needs to change some user passwords based on some user actions. Since this application can run on Redhat AS2.1 / AS4.0 / Solaris 9 etc, the most safe and portable solution that I could think of was: Use expect. Now, expect is not available on all... (1 Reply)
Discussion started by: namityadav
1 Replies

2. Shell Programming and Scripting

Korn shell interactive script

Hi, How can I prompt a user for two input and pass the input to variables in the script. I have the following script but it is not working: +++++++++Begin+++++++++++ #!/bin/sh database_c=$1 output_f=$2 echo "Your db is $1\nOutput is $2" +++++++++End+++++++++++ Thanks, Leonard (3 Replies)
Discussion started by: leonard905
3 Replies

3. Shell Programming and Scripting

Schedule an interactive shell script

Hi, I need to schedule a shell script which executes another shell script along with a series of other commands. When the inner shell script is executed it prompts for a password..... This inner shell cannot be changed How can I do this???? Regards, Chaitrali. (4 Replies)
Discussion started by: Chaitrali
4 Replies

4. Shell Programming and Scripting

how to run shell script inside expect script?

I have the code like this : shell script continues ... .... expect -c" spawn telnet $ip expect "login:" send \"$usrname\r\" expect "Password:" send \"$passwd\r\" expect "*\>" send \"$cmdstr\r\" ... (1 Reply)
Discussion started by: robbiezr
1 Replies

5. Homework & Coursework Questions

Help with Interactive / Non Interactive Shell script

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (1 Reply)
Discussion started by: rits
1 Replies

6. Programming

Expect script to run a Shell script on remote server

Hi All, I am using a expect script to run a shell script on remote server, the code is as follows. But the problem is that it executes only first command, and hangs it doesn't run the next commands. spawn ssh $uid@$host expect "password:" send "$password\r" expect "*\r" send... (2 Replies)
Discussion started by: yashwanthsn
2 Replies

7. Shell Programming and Scripting

Expect command use for interactive mode of scripting

Hi All, I am writing a script(Auto_Installation.sh) which is calling one another script (./update_manager /spare/install/HO7/PME_Response_file.txt) Now the issue is result of (./update_manager /spare/install/HO7/PME_Response_file.txt) script is ##########################################... (6 Replies)
Discussion started by: Dhruvak
6 Replies

8. Shell Programming and Scripting

Shell script using an interactive command

Hello experts, I have a to write script for monitoring, the script would use a command and I plan to write the script as follows while true do command -arg sleep 2 clear done The output would be set up on a screen for monitoring. However the issue is that the command used in... (2 Replies)
Discussion started by: maverick_here
2 Replies

9. Shell Programming and Scripting

Cannot get this bash/expect script to run under a crontab

#!/bin/bash # # RAP configuration script # # Usage: ./rap.sh # # Requires: expect, tcl # # Script expects to find a file called rap.csv located in the same directory as the script. If the file is placed # in a different directory, modify the custom entries section to specify the absolute... (8 Replies)
Discussion started by: mrkool
8 Replies

10. UNIX for Advanced & Expert Users

Unable to run the script on remote machine Using Expect script

Not able to execute the file in remote host using except utility I am automating the SFTP keys setp process: So i created the expect script for controlling the output of shell below is my main code: Code: #!/usr/bin/expect set fd set password close $fd set df set app close $df... (1 Reply)
Discussion started by: Manoj Bajpai
1 Replies
SYNCE-INSTALL-CAB(1)					   http://synce.sourceforge.net/				      SYNCE-INSTALL-CAB(1)

NAME
synce-install-cab - install .cab file SYNOPSIS
synce-install-cab [-d LEVEL] [-p device_path] [-o WCE_OPT] [-n] FILENAME ... DESCRIPTION
synce-install-cab installs a .cab file on a device connected through SynCE. OPTIONS
-d LEVEL Set debug log level: 0 - No logging (default) 1 - Errors only 2 - Errors and warnings 3 - Everything -p PATH Path to device -h Display help message. -o WCE_OPT Flags to pass to wceload.exe on the remote device. Useful flags include: /noui - Install silently /delete 1 - Don't delete CAB file after installation /nouninstall - Don't create an uninstall file /askdest - Ask where to install /noaskdest - Get install information from registry -n Don't run wceload (just copy CAB files) FILENAME The .cab file(s) that will be installed. If no filenames are specified, wceload.exe will nontheless be run on the remote device; this will install any CAB files already copied, for example with the -n flag. AUTHOR
David Eriksson <twogood@users.sourceforge.net>. SEE ALSO
synce(1) synce-remove-program(1) synce-list-programs(1) prun(1) pcp(1) The SynCE project November 2002 SYNCE-INSTALL-CAB(1)
All times are GMT -4. The time now is 12:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy