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

Re: bash script globbing

2015-09-20 22:20 GMT+02:00 <rlharris@oplink.net>:
I have been using the following script (named "enscript+") as a substitute
for the package "a2ps":

    enscript --media=letter -2 --landscape --borders \
    --header='$n|A.D. $D{%Y.%m.%d}|$* gmt | Page $% of $=' "$1"

    Here "$1" means "for the first argument"
   If enscript can work with several files together, you cn substitue "$1" simply
  by "$@"
  If however enscript can only work one file at a time, you can do the following:

for f in "$@"
  <same enscript line substituting "$f" for "$1">

     Hope this helps.

The script works properly for a single file:

    enscript+ filename

But when I execute

    enscript+ *

in a directory containing several files, enscript prints only the first
file in the directory.

I googled "bash script globbing", but the discussions which I found are
deep and confusing.  Is there not a simple solution?


Reply to: