The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
i cant send mail dereckfun HP-UX 1 12-04-2007 08:24 AM
Send a mail garric Shell Programming and Scripting 5 08-09-2007 09:50 AM
send mail after script finishes running srikanthgr1 Shell Programming and Scripting 2 04-25-2007 05:22 AM
How to prevent job1 from running while job2 is running.. tikang UNIX for Advanced & Expert Users 3 09-14-2006 02:40 AM
how can i send to printer ? umen SUN Solaris 1 02-08-2006 01:40 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-11-2008
Registered User
 

Join Date: Jun 2008
Posts: 3
Stumble this Post!
send y /n to a procces after itīs running

Hello

Iīm a senior Unix technician, i have a problem: I need send "y" and "enter" to a proccess that are running in memory. I explain that.

I have a server with Suse 10.3 that itīs runnig informix 11.10, this server are a backup server of a database server, to ensure the integrity of data y need execute a command "ontape -l" this command is interactive, and ask you to send a "yes enter" when you change the backup tape.

Mi problem is that command can interrup, because itīs change the state of database when itīs aborted, well i need make script to execute dayli that send "yes enter" to this proccess.

I try redirectin standard input, but this itīs only valid for one execution, example:

temp.txt
[status printer1
stop printer 2
]

serverBD:/DATA/LOGS # lpc < kk.txt
lpc> hpmater1:
printer is on device 'socket' speed -1
queuing is enabled
printing is enabled
no entries
daemon present
lpc> hpmater11:
printer is on device 'socket' speed -1
queuing is enabled
printing is enabled
no entries
daemon present

but this solution not solve my problem because, i need lpc running always

I try with jobs, making invoke call similar to:

echo "y \n"|fg pid

but Iīm not capable to make it works

anyone have a idea?, how i can send "y n" to a proccess that have standar input in shell and can not be aborted never.

Very very thanks.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-11-2008
Moderator
 

Join Date: Feb 2007
Posts: 1,961
Stumble this Post!
Maybe you can try to pipe the output of the yes command to your program, something like:

Code:
yes | yourprogram
Reply With Quote
  #3 (permalink)  
Old 06-13-2008
Registered User
 

Join Date: Jun 2008
Posts: 3
Stumble this Post!
thanks, but this not work, because yes send y continuisly, and I need only pass yes when I decide.

Today have found a solution, not for this, but i discoverd that ontpa -l can be used in this form ontape -l -C an this command not change the state of database, with this my problem is rosolved y can invoke ontape -l -C when i need.

Thanks for all
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0