parallel: Give warning if stdin is tty

This commit is contained in:
Ole Tange 2010-10-06 20:29:16 +02:00
parent 692bb88453
commit 44bdda5387
2 changed files with 34 additions and 0 deletions

View file

@ -1,3 +1,10 @@
== Change number of jobs while running ==
Read -j from file. If the file is changed when a job completes the
file is re-read and the new number of jobs computed. If the number is
lower than before currently running jobs will be allowed to finish but
new jobs will not be started.
== Bug == == Bug ==
(echo ; echo abc ; echo abc; echo ; echo bbc) | parallel --colsep b -v echo {1}{2} (echo ; echo abc ; echo abc; echo ; echo bbc) | parallel --colsep b -v echo {1}{2}

View file

@ -1407,6 +1407,29 @@ computers:
B<echo >>B<jobqueue>; B<tail -f jobqueue | parallel -S ..> B<echo >>B<jobqueue>; B<tail -f jobqueue | parallel -S ..>
=head1 EXAMPLE: GNU Parallel as dir processor
If you have a dir in which users drop files that needs to be processed
you can do this on GNU/Linux (If you know what B<inotifywait> is
called on other platforms file a bug report):
B<inotifywait -q -m -r -e CLOSE_WRITE --format %w%f my_dir | parallel
-u echo>
This will run the command B<echo> on each file put into B<my_dir> or
subdirs of B<my_dir>.
The B<-u> is needed because of a small bug in GNU B<parallel>. If that
proves to be a problem, file a bug report.
You can of course use B<-S> to distribute the jobs to remote
computers:
B<inotifywait -q -m -r -e CLOSE_WRITE --format %w%f my_dir | parallel -S ..
-u echo>
=head1 QUOTING =head1 QUOTING
For more advanced use quoting may be an issue. The following will For more advanced use quoting may be an issue. The following will
@ -2577,6 +2600,10 @@ sub parse_options {
$Global::default_simultaneous_sshlogins; $Global::default_simultaneous_sshlogins;
} }
} }
if(-t $Global::argfile) {
print STDERR "$Global::progname: Input is tty. Press CTRL-D to exit.\n";
}
} }
sub read_args_from_command_line { sub read_args_from_command_line {