bug-oleo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading stdin


From: Pete Wyckoff
Subject: Re: Reading stdin
Date: Wed, 15 Jan 2003 19:44:27 -0500

address@hidden said:
> Why am I getting an "Unknown OLEO line"?  I am trying to read the piped
> input into Oleo.

Maybe since your input file was not in "oleo" format.  Try specifying,
for instance, list format:

    echo -e '1\t2\t3\t4\t5' | src/oleo --filter --format list

or csv:

    echo 1,2,3,4,5 | src/oleo --filter --format csv

Incidentally, if you get SEGV, try the following patch I just checked
into the cvs which tries not to print a filename for stdin.

                -- Pete

> telinux7{jddahl}188> cat data.file
> 1 2 3 4 5
> 
> telinux7{jddahl}189> !! | oleo --filter
> cat data.file | oleo --filter
> oleo: Line 1: Unknown OLEO line "1 2 3 4 5"
> Error in the builtin init scripts (a bug!).

Index: src/io-term.c
===================================================================
RCS file: /cvsroot/oleo/oleo/src/io-term.c,v
retrieving revision 1.56
diff -u -r1.56 io-term.c
--- src/io-term.c       23 Nov 2001 21:28:44 -0000      1.56
+++ src/io-term.c       16 Jan 2003 00:36:08 -0000
@@ -1058,9 +1058,8 @@
        fprintf(stderr, "F: optind %d argv[optind] '%s' optopt %d %c\n",
                optind, argv[optind], optopt, optopt);
 #endif
-           option_format = argv[optind];
+           option_format = optarg;
            file_set_default_format(option_format);
-           optind++;
            break;
          case '-':
                option_filter = 1;
@@ -1198,7 +1197,13 @@
 
 
   if (option_filter) {
-           read_file_and_run_hooks(stdin, 0, "stdin");
+    if (setjmp(Global->error_exception)) {
+       fprintf (stderr, _("   error occured in stdin near line %d."),
+         Global->sneaky_linec);
+       io_info_msg(_("   error occured in stdin near line %d."),
+         Global->sneaky_linec);
+    } else
+       read_file_and_run_hooks(stdin, 0, "stdin");
   } else if (argc - optind == 1) {
       FILE * fp;
       /* fixme: record file name */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]