From: Jason Stephenson Date: Thu, 28 Jan 2016 13:55:22 +0000 (-0500) Subject: LP#1539088: marc_export prints "Waiting for input" when non-interactive X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b7890baa23654aa2b65a7b00bed8a26c8ab310a2;p=working%2FEvergreen.git LP#1539088: marc_export prints "Waiting for input" when non-interactive This commit modifies marc_export to only print "Waiting for input" when run in an interactive manner. This suppresses the output when run from a pipe. To test this change: Before the commit is applied both of the following command lines will output "Waiting for input" to standard error: $ marc_export --format XML $ echo | marc_export --format XML Where you replace with a bibliographic record entry id from your database. After the commit is applied, only the first command line will output the "Waiting for input" message. Signed-off-by: Jason Stephenson Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/support-scripts/marc_export.in b/Open-ILS/src/support-scripts/marc_export.in index 70a659f8e8..2ae13e255d 100755 --- a/Open-ILS/src/support-scripts/marc_export.in +++ b/Open-ILS/src/support-scripts/marc_export.in @@ -34,7 +34,7 @@ Fieldmapper->import(IDL => $config->option_value('xml-idl')); # Look for passed in ids: my @ids = (); if ($config->need_ids()) { - print STDERR "Waiting for input\n"; + print STDERR "Waiting for input\n" if (-t); while (my $i = <>) { push @ids, $i if ($i =~ /^\s*[0-9]+\s*$/); }