[Top][All Lists]

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

Re: bash lacks perl's "x" repetition operator

From: Al Elgert
Subject: Re: bash lacks perl's "x" repetition operator
Date: Thu, 12 Feb 2004 23:32:32 +0100
User-agent: Mutt/1.5.2i

Dan Jacobson schrieb am 13.02.2004 um 03:38:13 (+0800):
> >> Perhaps add this to the cwgen man page as an interesting exercise:
> >> $ cwgen -c '             VU'|cw -w 25
> Joop> Nice! Seems like a good exercise, will add it to the manpage.
> Also: emulate real radio stations:
> $ c=hlf; yes cq cq cq de $c $c $c qsx 12mhz k '            '|cw -w 20
> Alas, both the above could be made less goofy looking if bash only had
> perl's "x" repetition operator.

Perl's regular expression and pattern matching or regex(7) would be nice too,
but I missed this feature rarely. And there are ways to emulate this
functionality - but this is not very nice to write and read.

I wrote a function to do the same as the "x" operator in perl does.
This function should not be used for extreme long strings, because it is
optimized for speed, not memory.


Attachment: line---
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]