As loops are executed in a subshell, they can't read from the same stdin as the script is executed.
I'm afraid I don't fully understand. I see the logic in attaching the -sn1 to the read file. That makes it accept y, Y, yes, Yes, n, N, no, and No without having to go through the whole if or statement that I wrote. But I don't know what the -a < $(tty) does. and I don't see how it would help me deal with the stdin issue.
Do you know of a way I could write my code to get around that?
Hi all
Does anyone have a script that will allow me to stop inside a while read loop.
I want to pause the loop until a enter is pressed.
e.g.
While read line
do
echo something
if LINECOUNT > 40
then
read ENTER?"PRESS ENTER TO CONT..."
... (3 Replies)
hi!
i need to do a ksh script that uses a wile loop that is fed form below
while read line
do
some things
done < myfile
inside the while loop i need to read user input to ask the user what he wants to do, but "read" reads the file, and not the standard input
while read line
do
... (2 Replies)
Hello, i know how to retrieve a user input (read), and how to manage the different options (case statement).
But... could anybody show me a script that, if the user option is incorrect, don't allow to continue the excution, i.e., if the value entered is not 1 or 2, the script shows a question.
... (2 Replies)
until
do
read -p "Invalid cars. Try againa" cars1
done
Ok i have the above code, im getting users input and if it doesnt match in the file the user has to try again untill its correct
But when i run this it gives me an error saying
./Cars.bash: line 43: (2 Replies)
Hi Dears,
I have one script to create new users with information in one plain text file. This script will read all lines in the file and create one users for one line.
Sample file:
#action;login,full name title,expire date,project
+;gmwen,Bruce Wen QA,04/01/2012,BT
+;xxdeng,Shown Deng... (4 Replies)
I need to Write a shell script that allows some system-administration tasks to be preformed automatically from a menu-driven interface. with automated following tasks:
Copy directory tree
Delete files or directories
Output Information (this part is done )
*Copy directory tree
The “Copy... (2 Replies)
I have a shell script, and its pretty much done, I decided to add a loop that ends or continues depending on user input. like "would you like to continue?" and if I hit y or yes it will run the loop again until I hit n or no and breaks out of the loop.
To be hones I didn't think I needed to add... (2 Replies)
Hi,
This query is a part of a much more lengthy script.
I wish to look for all the files in a folder named "data" which in this case has two files i.e. plan.war and agent.properties. For all the files found under data I wish to ask the user as to where they wish copy the files to.
Below,... (14 Replies)
Hi All,
#!/bin/bash
#Just trying to check if letters are in the user input. Any tips?
# I have tried regexp and using 0-9 etc, i cannot get this to work either in just an if statement or while in a loop.
echo "Please pick a number"
read num
if ; then
echo "Please enter a number"... (7 Replies)
Discussion started by: jvezinat
7 Replies
LEARN ABOUT MOJAVE
apache::testrun
Apache::TestRun(3) User Contributed Perl Documentation Apache::TestRun(3)NAME
Apache::TestRun - Run the test suite
SYNOPSIS DESCRIPTION
The "Apache::TestRun" package controls the configuration and running of the test suite.
METHODS
Several methods are sub-classable, if the default behavior should be changed.
"bug_report"
The "bug_report()" method is executed when "t/TEST" was executed with the "-bugreport" option, and "make test" (or "t/TEST") fail. Normally
this is callback which you can use to tell the user how to deal with the problem, e.g. suggesting to read some document or email some
details to someone who can take care of it. By default nothing is executed.
The "-bugreport" option is needed so this feature won't become annoying to developers themselves. It's automatically added to the
"run_tests" target in Makefile. So if you repeateadly have to test your code, just don't use "make test" but run "t/TEST" directly. Here is
an example of a custom "t/TEST"
My::TestRun->new->run(@ARGV);
package My::TestRun;
use base 'Apache::TestRun';
sub bug_report {
my $self = shift;
print <<EOI;
+--------------------------------------------------------+
| Please file a bug report: http://perl.apache.org/bugs/ |
+--------------------------------------------------------+
EOI
}
"pre_configure"
The "pre_configure()" method is executed before the configuration for "Apache::Test" is generated. So if you need to adjust the setup
before httpd.conf and other files are autogenerated, this is the right place to do so.
For example if you don't want to inherit a LoadModule directive for mod_apreq.so but to make sure that the local version is used, you can
sub-class "Apache::TestRun" and override this method in t/TEST.PL:
package My::TestRun;
use base 'Apache::TestRun';
use Apache::TestConfig;
__PACKAGE__->new->run(@ARGV);
sub pre_configure {
my $self = shift;
# Don't load an installed mod_apreq
Apache::TestConfig::autoconfig_skip_module_add('mod_apreq.c');
$self->SUPER::pre_configure();
}
Notice that the extension is .c, and not .so.
Don't forget to run the super class' c<pre_configure()> method.
"new_test_config"
META: to be completed
perl v5.18.2 2015-06-18 Apache::TestRun(3)