LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-18-2010, 06:12 AM   #1
dpnctl
LQ Newbie
 
Registered: Mar 2010
Posts: 15

Rep: Reputation: 0
scripting with interruptions


Hi Team,
We have a program which needs some information to be fed. (Like ssl certificate generation.).
This activity takes around 40 servers. Is there a possibility to make entries in a text file and parse the same to the program.
The program will be a part of the script.
Warm regards
dpnctl
 
Old 03-18-2010, 06:26 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,391

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
If(!) i understand the qn, you'll want the Expect tool.
 
Old 03-18-2010, 06:36 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
If I understand the question (and I understand it differently from chrism01!) then, yes, a script can take values from a file. The easiest way is to create a file which is a snippet of shell script and to source it. Here's a simple illustration.
Code:
c@CW8:/tmp$ echo 'x=15' > input.txt
c@CW8:/tmp$ source input.txt
c@CW8:/tmp$ echo $x
15
 
Old 03-18-2010, 06:42 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,391

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
I think he wants both; he wants to be able to feed values into progs that accept human type input (like when you generate an SSL cert at the cmd line). He'll need the answers in a file, then use Expect to feed them into the program.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox Scripting Add-on (Scripting HTML / Javascript inside Firefox) linuxbeatswindows Programming 1 09-18-2009 10:09 PM
count interruptions generated by the mouse l_linux Linux - Kernel 0 06-26-2009 02:30 PM
need help in scripting..... raghuvamsi Programming 2 06-27-2008 04:59 AM
new in scripting bob4linux Programming 10 10-27-2007 05:54 PM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration