Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Search Forums:



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

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-21-2009
Registered User
 

Join Date: Feb 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Pbrun command problem

Hi,
I want to automate pbrun command in one of my project but the problem is when i am running pbrun command then it is asking for some input as identification no.I redirect that number through a file but it's not working. I didn't got any option for that to pass it as command line.Is there any way to pass it so that i should not be forced it to pass as manually.If any one has any idea plz help....
Sponsored Links
    #2  
Old 03-21-2009
Registered User
 

Join Date: Feb 2007
Location: india,mumbai
Posts: 174
Thanks: 5
Thanked 5 Times in 5 Posts
echo "YES" | Passyes.sh
Sponsored Links
    #3  
Old 03-21-2009
TonyFullerMalv's Avatar
Registered User
 

Join Date: Sep 2008
Location: Malvern, Worcs. U.K.
Posts: 1,032
Thanks: 0
Thanked 6 Times in 6 Posts
If the above does not work then try using expect(1);


Code:
#!/usr/local/bin/expect -f
spawn pbrun $argv 
expect "question" 
send "answer\r"

Replace the "question" string with what pbrun says, replace "answer" with your desired response.
    #4  
Old 03-23-2009
Registered User
 

Join Date: Feb 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,
The first solution that u provided will work for normal scripts but not for pbrun command.Second one is right but i don't want to use expect.any other solution
Sponsored Links
    #5  
Old 03-24-2009
TonyFullerMalv's Avatar
Registered User
 

Join Date: Sep 2008
Location: Malvern, Worcs. U.K.
Posts: 1,032
Thanks: 0
Thanked 6 Times in 6 Posts
If the questions and answers are always in the same order and the programme you are using supports it then you can use heretext, e.g.:


Code:
pbrun << EEOOFF
yes
no
1
fred
EEOOFF

Sponsored Links
    #6  
Old 03-24-2009
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
 

Join Date: Oct 2003
Location: 54.23, -4.53
Posts: 1,694
Thanks: 1
Thanked 61 Times in 56 Posts
Another solution posted here: http://www.unix.com/shell-programmin...#post302290616
I'm not sure about the security implications in using this method.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with /usr/bin/cd command raghu.amilineni Shell Programming and Scripting 5 03-03-2009 08:17 PM
Exit Shell Prompt after Pbrun ishanc Shell Programming and Scripting 4 02-25-2009 10:11 AM
problem with output of find command being input to basename command... new_learner UNIX for Dummies Questions & Answers 2 12-14-2008 01:56 AM
where is the problem in my sed command.... P_W UNIX for Dummies Questions & Answers 5 04-20-2007 09:48 PM
problem with dd command or maybe AFS problem Anta Shell Programming and Scripting 0 08-25-2006 10:10 AM



All times are GMT -4. The time now is 12:41 AM.