LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-08-2012, 09:15 PM   #1
scriptme101
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
executing perl script inside shell script


Hello,

I am making one shell script, that at one point calls a perl script. I am able to get it to execute the perl script, however, I am wondering if there is any way to send commands after execution (by running the script in the background?) For example, the perl script takes in text entered by a user in multiple categories, allowing the user to proceed to the next category using ctrl+d, then upon completion generates email from the input data, I'd like to execute the perl script from my csh script and send it input data for each category. Would this be possible? Any help or suggestions of other ways to accomplish this I might not of thought of would be greatly appreciated.

Thanks!
 
Old 04-09-2012, 01:26 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Arch
Posts: 10,035

Rep: Reputation: 3203Reputation: 3203Reputation: 3203Reputation: 3203Reputation: 3203Reputation: 3203Reputation: 3203Reputation: 3203Reputation: 3203Reputation: 3203Reputation: 3203
I am not sure I follow? If you are running the perl script inside your csh script, are you saying it is not asking you to enter the data mentioned?
 
Old 04-09-2012, 03:07 AM   #3
scriptme101
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
clarification

Hello,

Sorry not the easiest thing to explain. The perl script executes normally from the c shell script, and it's prompting me to enter the input data manually. However, I am trying to get it so that I can send it the input data directly from my csh script instead of the the user having to input the data manually. Is that possible?

Thanks again!
 
Old 04-11-2012, 09:30 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
By your description, it sounds like the Perl script needs to see an EOF to terminate it's read()s. That makes it tricky, because your C-Shell script would have to iteratively redirect some of it's content, probably using a 'here'document' concept. I cannot envision any way to accomplish that. It would be better to use some delimiter other than EOF, such as a blank line, or a line with only a '.' (period), which are both somewhat conventional. Perhaps post a fragment of the Perl code that shows how your iterative read()s are being done.

--- rod.
 
  


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
Executing a awk command inside perl script -- Alkass Linux - Newbie 1 07-30-2011 10:33 AM
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 07:58 PM
Problem executing mv command inside shell script pablogosse Linux - General 7 12-16-2009 12:21 PM
Runs Multiple shell script inside a main script using crontab srimal Linux - Newbie 4 10-22-2009 06:19 PM
perl inside a shell script baidym Linux - Newbie 2 05-05-2008 06:42 PM

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

All times are GMT -5. The time now is 07:07 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