| |
comp.unix.programmer |
In article <pan.2009.07.04.06.09...@tznvy.pbz>, > E.g., > $ MyLineFilter < TextFile # OK > $ Some Command | MyLineFilter # OK > $ MyLineFilter > $ echo $? > $ MyLineFilter Command Line Args # Undecided what to do here ... > Would appreciate some ideas on how to implement this. > Currently, am writing the usage information to stderr (unconditionally), If you don't want to take input from the terminal, you can use: if test -t --
Anand Hariharan <znvygb.nanaq.unevun...@tznvy.pbz> wrote:
> do, however, is if there is no input at start-up, it should present some
> usage information and exit.
> MyLineFilter: Did not find any text to process. Exiting.
> 1
> but the executable waits for input until it finds EOF.
terminal, and the user is supposed to type the input.
then echo $0: Did not find any text to process. Exiting. >&2
exit 1
fi
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***