Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Linux Console for Interactive Input Script Post 302963617 by sea on Monday 4th of January 2016 07:23:05 AM
Old 01-04-2016
You could try:
Code:
msfconsole<<EO_INPUT
load openvas
openvas_help
<your commands>
EO_INPUT

However, that would require you to know in advance what you are going to type in.

You might want to have a look at expect', i belive (but not sure) that is for such situations.

hth

EDIT:
Yes, to 'mute' errors, one would use: <cmd> 2>/dev/null
 

10 More Discussions You Might Find Interesting

1. Programming

Changing stdin from file redirection to console input

Hi I am doing file redirection at console for use by my binary. %console%> bin &lt inputfile After reading in the entire file, I want my program to continue taking input from the console. So essentially I want to redirect stdin back to console. But I cant figure out how to do it. I am... (4 Replies)
Discussion started by: nauman
4 Replies

2. Shell Programming and Scripting

put an interactive script in background after taking input

i am trying to find a way to put an interactive script in the background after taking input from the user a few test lines i was trying: date echo "Enter location" LOCATION= read LOCATION sleep 100 sleep 200 date for this small example i want the script to as the user for the... (7 Replies)
Discussion started by: epsilonaurigae
7 Replies

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

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

5. UNIX for Dummies Questions & Answers

Windows to Linux remote console using VNC brings up blank console screen with only mouse pointer

:confused:Hi This was installed on the Linux box a few weeks back by a guy that no longer works for us. All worked fine until last week. Now when we connect its just a blank screen with no icons. I get a whole bunch of errors when starting the service too: Tue Feb 23 14:29:45 2010 ... (1 Reply)
Discussion started by: wbdevilliers
1 Replies

6. UNIX for Advanced & Expert Users

Console Input from a file

hi 2 all whatever in a file that line have to come in console screen .. when i execte that script ... >cat abc date ls >./abc >date ---->that line hav to come here > ls ----> that line hav to come here please anyone help me ! (4 Replies)
Discussion started by: ponmuthu
4 Replies

7. Shell Programming and Scripting

interactive scripts with user input that includes quotes

I'm writing a basic ldapsearch script that prompts the user for their search criteria. The input they're being asked for is the search filter portion of the ldapsearch command. This string must be quoted. When the script executes the command it returns nothing. If I hard code a search filter it... (1 Reply)
Discussion started by: donniemac
1 Replies

8. Linux

Linux extacting msg from script to console

how to get the outout from script to console. i am running one script msg.sh using cron job every suday midnight. as soon as i logged in i want to see the staus is service started or service failed on console. what command i need to add to script ? msg.sh #!/bin/bash if then echo... (1 Reply)
Discussion started by: saku
1 Replies

9. Shell Programming and Scripting

How to redirect the messages from the script to console in Linux?

msg.sh #!/bin/bash if then echo "starting service" else echo " service not started" echo " Please check the start.sh file or manuly start the service" fi if i login with root credentials @12.36.34.123 with passwd username:root passwd:abc once i login into linux pc... (6 Replies)
Discussion started by: saku
6 Replies

10. Shell Programming and Scripting

Recording user input from interactive shell script

Hello, I want to start out by saying that I am fairly new to scripting and am looking for someone that can point me in the right direction. Basically what I need is a way to run a interactive script that will prompt users with questions weather that be yes/no or a specific answer.. I want to be... (3 Replies)
Discussion started by: shoutcast
3 Replies
PERLCONSOLE(1p) 					User Contributed Perl Documentation					   PERLCONSOLE(1p)

NAME
perlconsole - light program that lets you evaluate Perl code interactively. COPYRIGHT
Perl Console is Copyright (C) 2007 by Alexis Sukrieh DESCRIPTION
Perl Console is a small program that implements a Read-eval-print loop: it lets you evaluate Perl code interactively. It uses Readline to grab input, and provides completion with all the namespaces loaded during your session. It allows you to load a module in your session and test a function exported by it. COMMANDS
It's possible to interact with the console with internal commands. The following commands are supported in this version: :help display the interactive help screen :quit quit the console :set set a preference (see PREFERENCES). RCFILE
PerlConsole will look for a rcfile located in your home directory called: ~/.perlconsolerc Every line in that file will be evaluated as if they were issued in the console. You can then load there your favorite modules, or even define your preferences. Example of a valid ~/.perlconsolerc :set output = dumper use Date::Calc; PREFERENCES
Preferences can be set with the :set command. The following preferences are supported in this version: output changes the output of evaluated code For details about commands, ype :help <command> within the console. AUTHOR
Perl Console was writen by Alexis Sukrieh <sukria@sukria.net>. perl v5.12.4 2011-09-18 PERLCONSOLE(1p)
All times are GMT -4. The time now is 04:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy