Re: parameter list too long

From: David Douthitt (ssrat_at_mailbag.com)
Date: 11/14/03


Date: Fri, 14 Nov 2003 12:40:07 -0600

On Wed, 12 Nov 2003 23:56:05 +0100, Stephane CHAZELAS
<this.address@is.invalid> wrote:

>pattern comparison in ksh is made as:
>
>if [[ "$filename" = *.xml ]]
>
>or more portably:
>
>case "$filename" in
> *.xml) ...;;
>esac

Isn't the [[ ... ]] construct portable among ksh?

>Or, to avoid running one cp per file:
>
>ls -f | sed '/\.xml$/!d;s/./\\&/g' | xargs sh -c '
> shift "$1"; exec cp -- "$@" /download' 2 1
>
>(provided that filenames don't contain NL characters).

I understood your explanation of the shift et al (sneaky!) - but
what's the reason for the

s/./\\&/g

in sed?

David Douthitt (david@douthitt.net)
UNIX System Administrator
HP-UX, Unixware, Linux
Linux+, LPIC-1



Relevant Pages

  • Re: big bang problems
    ... then you will certainly feel that something needs explaining. ... daze of astonishment at every random occurrence in the universe.) ... candidate explanation that, while rather unlikely most of the ... might have a reason to do. ...
    (uk.religion.christian)
  • Re: Precession of the equinoxes ?
    ... imagine the Earth keeping one face toward the sun just ... You fabricated the "implausible explanation you've seen" all by yourself, ... Bluster and I'll come down ... argumentative cunt that I cannot reason with, ...
    (sci.physics)
  • Re: Effects of Magic
    ... the reason I was asking about shaping societies by magic ... character being carted around in a taxi. ... explanation of how magic works to undestand a fantasy story. ... added in) is in the S&E, where they substract Winter magic from Fire ...
    (rec.arts.sf.composition)
  • Re: OT - Proud to be an American?
    ... That explanation is based on the track record of the ... all-encompassing as yours, for some reason, is that it? ... over-extended, hapless, sons of bitches whom politicians have decided are ... sweep it aside and insult me and demean me yet ...
    (alt.support.stop-smoking)
  • Re: Dynamically resizing a buffer
    ... Because you consider shift an appropriate method of halving a number. ... define the result of right shifting a negative number). ... however, I reason, almost none of my crap is ever likely to be run on ... Linear is another natural growth curve. ...
    (comp.lang.c)