473,811 Members | 3,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automating user interaction

1 New Member
Hi All,

Can someone guide me on how we can modify the below script so that no user interaction is required to feed the password when the script is run, current scenario is like if I try to login to a different user from a user other than root it needs user interaction for that, but it should not ask for the user interaction and it should get the password from the script itself.

This is the script to modify;and it prompts me for the password as below;

$ ./ora1.pl
Data base is down
Password:

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. use Log;
  4. use testDMC;
  5.  
  6. my $logFH;
  7. my $testDMCRef;
  8. my %parameterHash;
  9. my $oracle_passwd;
  10.  
  11. $logFH = Log->new(1,"log/masterDMCTest.log");
  12. $testDMCRef = testDMC->new($logFH);
  13.  
  14. my $var = " ps -ef | grep ora_smon_dmc| grep -v \"grep\" ";
  15. my $execcommand = qx/$var/;
  16. if ($execcommand) {
  17.     print "Database is up\n";
  18. } else {
  19.     print "Data base is down\n";
  20.     #system("su - oracle");
  21.  
  22.     %parameterHash = $testDMCRef->ReadTestDmcConfig();
  23.     $oracle_passwd = $parameterHash{ORACLEUSRPWD};
  24.     system("su - oracle");
  25.     #print "\n$oracle_passwd\n";
  26.     #print "\nhello\n";
  27.     #system("sqlplus /nolog");
  28. }
  29.  
Aug 22 '07 #1
1 1611
miller
1,089 Recognized Expert Top Contributor
To automate user interation you will need to use the Expect module instead of the system command.

cpan Expect.

- Miller
Aug 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1517
by: Dan | last post by:
Hello all, Is it possible to disable user interaction from keybord? Thanks
2
1421
by: prakash.guru | last post by:
Hi Friends . I try to do a javascript program which automatically fire an event or redirects to a page when there is no user interaction between user & browser for 15 minutes. Is it possible in javascript? Thanks in advance Regards Prakash
3
4130
by: Aaron Queenan | last post by:
I have a form which performs some asynchronous code. I want to display a wait cursor when it starts, and hide the wait cursor when it has completed. This part works fairly well, using: this.TopLevelControl.Cursor = System.Windows.Forms.Cursors.WaitCursor; I also want to prevent user interaction with the controls on my form while the wait cursor is displayed, so that use events (except resize and cancel) are blocked. What is the...
4
1519
by: EvanK | last post by:
Is there a way to display a message box and have it close after a certain amount of time w/o user interaction?
3
2583
by: sheldonlg | last post by:
I don't think my last attempt posted so here it is again. This is a bit off-topic, but it does relate to php. This is the most active related group that I can find, so even if it is off-topic I hope you can help. (I have posted to alt.comp.mail.qmail, but that doesn't have much participation). Goal: I want the create an account in qmail (which is written in php). What I want to do is gather all the information from the user from a...
2
1981
by: Thinker | last post by:
Hi I am currently creating a web bot that simulates a user interaction with a webpage. The Bot's functionality would be similar to what an end user does on a data entry webpage Any information on this subject would be helpful, sample code is appreciated, and a discussion is wanted!
0
1184
by: Glenn Palomar | last post by:
Hi, I'm trying to simulate user interaction over an application. Using API's such as FindWindowEx, GetWindow, SendMessage, ShowWindow, etc. I am able to do a bunch of stuff already. I am however stucked in a scenario with a dialog (classname is "#32770") that contains buttons, SysListView32, SysTabControl32, etc. By the way I use Spy++ to identify the window.
2
2038
by: ext237 | last post by:
hello. I'm trying to halt a function's execution while waiting for user interaction. For example, I have a function called getUserValue() that pops up a hidden div containing several buttons. Each button sets a value. I want use a function to pop the box, wait for the users' button press, and then continue the function based on what the user presses.
3
1622
by: nelsonbrodyk | last post by:
Hey All, I can't see to find a nice solution to this. I have a textbox, and a button. When the textbox text is set by the user, I want the button to enable. When the text is set through code (ie. textbox.Text = "Hi"), I don't want it to fire the event. Is there an event that I can use that will listen only to user interaction and not programmatic changes? Thanks
0
9731
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.