Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #158098

Re: bash script globbing

From Loïc Grenié <loic.grenie@gmail.com>
Newsgroups linux.debian.user
Subject Re: bash script globbing
Date 2015-09-20 22:30 +0200
Message-ID <qaTpg-1Zo-3@gated-at.bofh.it> (permalink)
References <qaTpg-1Zo-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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":
>
>     #!/bin/bash
>     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 "$@"
do
  <same enscript line substituting "$f" for "$1">
done

     Hope this helps.

          Loïc


> 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?
>
> RLH
>
>
>

Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: bash script globbing Loïc Grenié <loic.grenie@gmail.com> - 2015-09-20 22:30 +0200
  Re: bash script globbing rlharris@oplink.net - 2015-09-20 23:30 +0200

csiph-web