Sponsored Content
Homework and Emergencies Homework & Coursework Questions Help with Interactive / Non Interactive Shell script Post 302344441 by Franklin52 on Sunday 16th of August 2009 04:39:16 PM
Old 08-16-2009
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

Double post of:

https://www.unix.com/shell-programmin...#post302344434

The UNIX and Linux Forums.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. OS X (Apple)

interactive shell script to create users 10.4

Hello everyone, Not sure if this is the right place, but OS X isn't your standard Unix, so I figured here would be best. I am looking at creating a script that will be interactive that admins can run to create users. Now, 10.4 uses netinfo database and netinfo manager to handle it's users. ... (3 Replies)
Discussion started by: tlarkin
3 Replies

4. Shell Programming and Scripting

how to write a shell script to login to a system which is interactive.

Can anybody help me to write a shell script to login interactive system once u open a connection using telnet it will ask for USERCODE: PASSWORD: DOMAIN: (1 Reply)
Discussion started by: sudhakaryadav
1 Replies

5. Shell Programming and Scripting

How to make interactive shell script a automated one?

Hi, I am new to shell scripting.I have written a very simple shell scipt that asks for the username and password on executing. i.e echo "Enter username :" read usrname; echol "Enter password :"; read passwd; echo usrname; echo passwd; but now I want to make it automatic , such... (2 Replies)
Discussion started by: bhaskar_m
2 Replies

6. Homework & Coursework Questions

How to write script that behaves both in interactive and non interactive mode

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... (8 Replies)
Discussion started by: rits
8 Replies

7. Shell Programming and Scripting

Use expect to run an interactive shell script?

Hi all, I have a bit of a vexing issue here and I'm not certain how best to go about it. Basically, I want to run a shell script and automate the user prompt of hitting 1 to fully uninstall Symantec Anti-Virus for OS X. Would expect be the best way to do this? (5 Replies)
Discussion started by: prometheon123
5 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. UNIX and Linux Applications

How to write automated interactive shell script?

Hello everyone, I just want to write a shell script for automatic feeding the username and password prompts when running my commands, I tried this one but it did not work. Please help me for any way out. #!/bin/bash #!/usr/bin/expect cd ~/workspace/mimosanetworks_mimosa-nms ls -ltr ... (5 Replies)
Discussion started by: sandy-sm
5 Replies

10. UNIX for Beginners Questions & Answers

Problems executing an interactive shell script

I am new to Unix shell and to this forum. I am having some trouble executing an interactive shell script that I have written using Mac TextEdit that takes a user input via terminal of a file type (jpg or gif) and then activates a script that will iterate through a folder of unsorted file types... (4 Replies)
Discussion started by: Braveheart
4 Replies
IO::Interactive(3pm)					User Contributed Perl Documentation				      IO::Interactive(3pm)

NAME
IO::Interactive - Utilities for interactive I/O VERSION
This document describes IO::Interactive version 0.0.6 SYNOPSIS
use IO::Interactive qw(is_interactive interactive busy); if ( is_interactive() ) { print "Running interactively "; } # or... print {interactive} "Running interactively "; $fh = busy { do_noninteractive_stuff(); } DESCRIPTION
This module provides three utility subroutines that make it easier to develop interactive applications... "is_interactive()" This subroutine returns true if *ARGV and the currently selected filehandle (usually *STDOUT) are connected to the terminal. The test is considerably more sophisticated than: -t *ARGV && -t *STDOUT as it takes into account the magic behaviour of *ARGV. You can also pass "is_interactive" a writable filehandle, in which case it requires that filehandle be connected to a terminal (instead of the currently selected). The usual suspect here is *STDERR: if ( is_interactive(*STDERR) ) { carp $warning; } "interactive()" This subroutine returns *STDOUT if "is_interactive" is true. If "is_interactive()" is false, "interactive" returns a filehandle that does not print. This makes it easy to create applications that print out only when the application is interactive: print {interactive} "Please enter a value: "; my $value = <>; You can also pass "interactive" a writable filehandle, in which case it writes to that filehandle if it is connected to a terminal (instead of writinbg to *STDOUT). Once again, the usual suspect is *STDERR: print {interactive(*STDERR)} $warning; "busy {...}" This subroutine takes a block as its single argument and executes that block. Whilst the block is executed, *ARGV is temporarily replaced by a closed filehandle. That is, no input from *ARGV is possible in a "busy" block. Furthermore, any attempts to send input into the "busy" block through *ARGV is intercepted and a warning message is printed to *STDERR. The "busy" call returns a filehandle that contains the intercepted input. A "busy" block is therefore useful to prevent attempts at input when the program is busy at some non-interactive task. DIAGNOSTICS
Unknown subroutine (%s) requested This module only exports the three subroutines described above. You asked for something else. Maybe you misspelled the subroutine you wanted. CONFIGURATION AND ENVIRONMENT
IO::Interactive requires no configuration files or environment variables. DEPENDENCIES
This module requires the "openhandle()" subroutine from the Scalar::Util module. INCOMPATIBILITIES
None reported. BUGS AND LIMITATIONS
No bugs have been reported. Please report any bugs or feature requests to "bug-io-interactive@rt.cpan.org", or through the web interface at <http://rt.cpan.org>. AUTHOR
Damian Conway "<DCONWAY@cpan.org>" Currently maintained by brian d foy "<bdfoy@cpan.org>" LICENCE AND COPYRIGHT
Copyright (c) 2005, Damian Conway "<DCONWAY@cpan.org>". All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. perl v5.10.1 2009-11-13 IO::Interactive(3pm)
All times are GMT -4. The time now is 03:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy