473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Automating user interaction

1
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 1583
miller
1,089 Expert 1GB
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
by: Dan | last post by:
Hello all, Is it possible to disable user interaction from keybord? Thanks
2
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...
3
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: ...
4
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
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...
2
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...
0
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...
2
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....
3
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....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...

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.