Sponsored Content
Full Discussion: Auto input with echo
Top Forums UNIX for Dummies Questions & Answers Auto input with echo Post 302765735 by lawsongeek on Sunday 3rd of February 2013 08:48:11 AM
Old 02-03-2013
cool. thanks. worked perfectly!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

suppress echo while reading input in expect

Hi all, I tried searching for similar threads. Couldn't get any for Expect scripting. I am trying automate a task which requires login to a machine. The user would be prompted for the password. Now, I want this input to be hidden from being displayed on the screen. Is there... (1 Reply)
Discussion started by: sudhir_onweb
1 Replies

2. Shell Programming and Scripting

usage of echo with standard input

Hi, I am passing the file filename to a program and I have to use the "<" sign: program < filename Inside the program I would like to assign the string "filename" to a variable var. I can't do that with "var=$(echo $1)" because of the "<" sign. Removing the "<" sign would work for echo,... (13 Replies)
Discussion started by: calandrea
13 Replies

3. Shell Programming and Scripting

problem piping input to script with echo

I am trying to have a script run without interaction from the command line. So in my script i have a line like this echo -e "\n\n\ny\ny\n" | ./script the goal being the ability to mimic 3 Enter presses and 2 'y/n' responses with 'y' followed by enter. For some reason tho, it is not... (1 Reply)
Discussion started by: mcdef
1 Replies

4. Shell Programming and Scripting

Putting echo output as input to stat

I have a string with escape differentiators as a result of searching for a file using find. Essentially find returned to my shell variable several absolute paths each ending with the file name and each path/file separated by \n. Echo recognizes the escape sequence and is able to print the paths... (3 Replies)
Discussion started by: Ebodee
3 Replies

5. Shell Programming and Scripting

Echo date variable from data input to a script

Hi, I'm trying to make a script which you type the year, select the month and day and then create the date in the format 2010-12-7. #!/bin/bash dia () { echo " Seleccione el dia:" select file in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Salir do... (6 Replies)
Discussion started by: iga3725
6 Replies

6. Shell Programming and Scripting

accept input on an echo output

echo (some info) read? <&1(not working for me) (1 Reply)
Discussion started by: robin_simple
1 Replies

7. Shell Programming and Scripting

How to read each line from input file, assign variables, and echo to output file?

I've got a file that looks like this (spaces before first entries intentional): 12345650-000005000GL140227 ANNUAL HELC FEE EN 22345650-000005000GL140227 ANNUAL HELC FEE EN 32345650-000005000GL140227 ANNUAL HELC FEE EN I want to read through the file line by line,... (6 Replies)
Discussion started by: Scottie1954
6 Replies

8. Shell Programming and Scripting

Auto input to fetch cluster manager details

Team, Presently i am trying to do basic checks on my my-sql cluster boxes. The command ndb_mgm checks for the cluster environment details by typing the show command, and exit to come out of the ndb_mgm command. Rather, than typing i have made a script abc.sh with the below contents in the... (4 Replies)
Discussion started by: whizkidash
4 Replies

9. Shell Programming and Scripting

Enhance existing script: Extract Multiple variables & Input in an echo string

Hi Experts I need your help to optimize my script to execute better as I have nearly 1M records & the script is taking close to 40 minutes to execute, so would need support on a faster alternative. Input: file {"house":"1024","zip":"2345","city":"asd","country":"zzv"}... (2 Replies)
Discussion started by: nk1984
2 Replies
Test::WWW::Mechanize::CGIApp(3pm)			User Contributed Perl Documentation			 Test::WWW::Mechanize::CGIApp(3pm)

NAME
Test::WWW::Mechanize::CGIApp - Test::WWW::Mechanize for CGI::Application SYNOPSIS
# We're in a t/*.t test script... use Test::WWW::Mechanize::CGIApp; my $mech = Test::WWW::Mechanize::CGIApp->new; # test a class that uses CGI::Application calling semantics. # (in this case we'll new up an instance of the app and call # its ->run() method) # $mech->app("My::WebApp"); $mech->get_ok("?rm=my_run_mode&arg1=1&arg2=42"); # test a class that uses CGI::Application::Dispatch # to locate the run_mode # (in this case we'll just call the ->dispatch() class method). # my $dispatched_mech = Test::WWW::Mechanize::CGIApp->new; $dispatched_mech->app("My::DispatchApp"); $mech->get_ok("/WebApp/my_run_mode?arg1=1&arg2=42"); # create an anonymous sub that this class will use to # handle the request. # # this could be useful if you need to do something novel # after creating an instance of your class (e.g. the # fiddle_with_stuff() below) or maybe you have a unique # way to get the app to run. # my $custom_mech = Test::WWW::Mechanize::CGIApp->new; $custom_mech->app( sub { require "My::WebApp"; my $app = My::WebApp->new(); $app->fiddle_with_stuff(); $app->run(); }); $mech->get_ok("?rm=my_run_mode&arg1=1&arg2=42"); # at this point you can play with all kinds of cool # Test::WWW::Mechanize testing methods. is($mech->ct, "text/html"); $mech->title_is("Root", "On the root page"); $mech->content_contains("This is the root page", "Correct content"); $mech->follow_link_ok({text => 'Hello'}, "Click on Hello"); # ... and all other Test::WWW::Mechanize methods DESCRIPTION
This package makes testing CGIApp based modules fast and easy. It takes advantage of Test::WWW::Mechanize to provide functions for common web testing scenarios. For example: $mech->get_ok( $page ); $mech->title_is( "Invoice Status", "Make sure we're on the invoice page" ); $mech->content_contains( "Andy Lester", "My name somewhere" ); $mech->content_like( qr/(cpan|perl).org/, "Link to perl.org or CPAN" ); For applications that inherit from CGI::Application it will handle requests by creating a new instance of the class and calling its "run" method. For applications that use CGI::Application::Dispatch it will call the "dispatch" class method. If neither of these options are the right thing, you can set a reference to a sub that will be used to handle the request. This module supports cookies automatically. Check out Test::WWW::Mechanize for more information about all of the cool things you can test! CONSTRUCTOR
new Behaves like, and calls, Test::WWW::Mechanize's "new" method. It optionally uses an "app" parameter (see below), any other parameters get passed to Test::WWW::Mechanize's constructor. Note that you can either pass the name of the CGI::Application into the constructor using the "app" parameter or set it later using the "app" method. use Test::WWW::Mechanize::CGIApp; my $mech = Test::WWW::Mechanize::CGIApp->new; # or my $mech = Test::WWW::Mechanize::CGIApp->new(app => 'TestApp'); METHODS
$mech->app($app_handler) This method provides a mechanism for informing Test::WWW::Mechanize::CGIApp how it should go about executing your run_mode. If you set it to the name of a class, then it will load the class and either create an instance and ->run() it (if it's CGI::Application based), invoke the ->dispatch() method if it's CGI::Application::Dispatch based, or call the supplied anonymous subroutine and let it do all of the heavy lifting. SEE ALSO
Related modules which may be of interest: Test::WWW::Mechanize, WWW::Mechanize. Various implementation tricks came from Test::WWW::Mechanize::Catalyst. AUTHOR
George Hartzell, "<hartzell@alerce.com>" based on Test::WWW::Mechanize::Catalyst by Leon Brocard, "<acme@astray.com>". COPYRIGHT
Copyright (C) 2007, George Hartzell This module is free software; you can redistribute it or modify it under the same terms as Perl itself. perl v5.8.8 2008-03-12 Test::WWW::Mechanize::CGIApp(3pm)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy