LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 06-11-2015, 12:01 AM   #1
nana-mohammadi
LQ Newbie
 
Registered: Jun 2015
Posts: 2

Rep: Reputation: Disabled
perl script does not work.


Hi
i should run a perl script. However, during runing it, an error titled "sh: 1: trav: not found " will be appeared. trav is an executed fortran in a part of whole script posted. I am not familiar with perl and do not know why it does not work.is there anyone to help me? running the script is extremely important for me.

# calculate arrival time for P and S
open(TRAV,"| trav > junk.p") or die "couldn't run trav\n";
printf TRAV "%d %d %d\n", $num_layer,$src_layer,$rcv_layer;
for ($j=0;$j<$num_layer;$j++) {
printf TRAV "%11.4f %11.4f\n",$th[$j],$vp[$j];
}
printf TRAV "%d\n",$#dist + 1;
foreach (@dist) {
printf TRAV "%10.4f\n",$_*$deg2km;
}
close(TRAV);
open(TRAV,"| trav > junk.s") or die "couldn't run trav\n";
printf TRAV "%d %d %d\n", $num_layer,$src_layer,$rcv_layer;
for ($j=0;$j<$num_layer;$j++) {
printf TRAV "%11.4f %11.4f\n",$th[$j],$vs[$j];
}
printf TRAV "%d\n",$#dist + 1;
 
Old 06-11-2015, 12:37 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
try to add full path to trav:
Code:
open(TRAV,"| /full/path/to/trav > junk.p") or die "couldn't run trav\n";
 
1 members found this post helpful.
Old 06-21-2015, 08:46 AM   #3
nana-mohammadi
LQ Newbie
 
Registered: Jun 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
pan64

Many thanks
it works.
 
  


Reply



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
Cron doesn't work for Perl script Ale87zorg Linux - Server 9 10-10-2012 03:46 PM
generate script perl mail log not work puka Programming 4 05-31-2011 11:54 AM
Modify Perl script to work with txt - Permissions script joangopan Programming 4 09-14-2007 09:20 PM
A Perl script doesn't properly work Hirszu Programming 4 11-29-2005 01:02 AM
Perl script for website won't work klintonray Programming 5 07-27-2003 06:04 AM

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

All times are GMT -5. The time now is 10:40 AM.

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