ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
Below is my final script that I am working on. But I am facing some problem here. The thing is at the end of the script I am invoking an application to process my image by using fits.bat -i and using fits.bat -o to capture the output but the output file which I am mentioning is getting overwrited by the files. In detail file 1 is being processed and output is going into output.txt next file2 is being processed and the output.txt gets overwrited by the file2 output and so on.... Finally the output.txt has onluy the output of the last file instead of all the files. Is there a way i can overcome this.
#!/usr/local/bin/perl
use File::Find ;
# Get the directory from the command line # or use the default directory
$search = shift || 'C:\Documents and Settings\user\Desktop\IMD025350802' ;
# Get an array of all subdirectories
find sub { push @dirs, $File::Find::name if -d }, $search ;
for $dir ( @dirs ) {
opendir $dh, $dir or do { warn "Cannot open '$dir' $!" ; next ; } ;
opendir( DIR, "$dir" ) ;
@files = grep( /\.jpg$/, readdir( DIR ) ) ;
closedir( DIR ) ;
foreach $file ( @files ) {
print "$dir/$file\n" ;
@args = ("C:\\Documents and settings\\user\\My Documents\\Downloads\\fits-0.4.2\\fits-0.4.2\\FITS.BAT", "-i", "$dir/$file","C:\\Documents and settings\\user\\My Documents\\Downloads\\fits-0.4.2\\fits-0.4.2\\FITS.BAT", "-o", "C:\\Documents and Settings\\user\\Desktop\\output\\out.txt");
system( @args ) == 0 or die "system @args failed: $?";
Hi,
The problem is solved. Created a logfilename variable and passed my file variable to it.
Thanks,
If user_28 and New_user_perl are _not_ the same user how is it possible you (user_28) decides that this thread is solved? It was started by New_user_perl.......
I have my doubts, but you seem to have convinced the moderator.
@user_28:If user_28 and New_user_perl are _not_ the same user how is it possible you (user_28) decides that this thread is solved? It was started by New_user_perl.......
I have my doubts, but you seem to have convinced the moderator.
Not the, a moderator (or Jeremy).
I find the story not overly plausible. Two friends
using the same machine to solve the same issue?
Seriously: Should this really be a moderator?
You seem to be the moderator that handled/(un)locked this and the other thread. A moderator sounds general and impersonal in this case, the moderator points to the one handling these threads.
English is not my first language so please correct me if I'm wrong.
Last edited by druuna; 08-18-2010 at 02:01 AM.
Reason: Made sentence more clear.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.