You can do this without external programs or pipes.
See the attachment.

JGH

On Mon, 6 Nov 2006, Dan Jacobson wrote:

Regarding the
      ${parameter/pattern/string}
      ${parameter//pattern/string}
discussion on the man page:
You don't mention what if pattern is null.
Seems that will never match.
Anyway, no way to
$ set aa bb cc
$ echo [EMAIL PROTECTED]
so that one gets all parameters to have a string appended,
e.g. aa.t bb.t cc.t
One must sacrifice at least one character in "pattern". No way to
destroy less than one character.

One must do
$ ls|sed s/$/.t/|xargs make -n
as there is no pure bash single shortcut to eliminate the pipes.
Brace Expansion not employable here either.
#! /bin/bash
add_t() {
  local rez=""
  local f

  for f
  do
    rez="${rez} ${f}.t"
  done
  printf "%s" "${rez}"
}

set aa bb cc
onedesire=$(add_t [EMAIL PROTECTED])
printf "make %s\n" "${onedesire}"
exit 0
_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to