Re: [vox-tech] Using awk or perl to find and replace

2004-11-23 Thread Foo Lim
On Tue, 23 Nov 2004, Trevor M. Lango wrote:

> I have been reading the man pages and I'm lost.  I want to scan through 
> an input file for an expression with this pattern:
> 
>     h.*.JPG
> 
> and replace it with an expression with the following pattern:
> 
>     *.h.JPG
> 
> Perl and awk both appear to be ideal candidates for just such a task 
> but I'm a serious newbie to both of 'em.  Any help much appreciated!

Hi Trevor,

Does the pattern "h.*.JPG" match something like this: h.abc123.JPG ?  
Since the period "." is a metacharacter in regular expressions.  If that's 
the case, then a perl script like this would work:

while (<>) {
  s/h\.(.*)\.JPG/$1.h.JPG/g;
  print;
}

FL

___
vox-tech mailing list
[EMAIL PROTECTED]
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Using awk or perl to find and replace

2004-11-23 Thread Ken Bloom
On Tue, Nov 23, 2004 at 10:33:56PM -0800, Trevor M. Lango wrote:
> I have been reading the man pages and I'm lost. ?I want to scan through 
> an input file for an expression with this pattern:
> 
> ? ? h.*.JPG
> 
> and replace it with an expression with the following pattern:
> 
> ? ? *.h.JPG
> 
> Perl and awk both appear to be ideal candidates for just such a task 
> but I'm a serious newbie to both of 'em. ?Any help much appreciated!

sed -e 's/h\.\(.*\)\.jpg/\1.h.jpg/g'

--Ken Bloom

-- 
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.


signature.asc
Description: Digital signature
___
vox-tech mailing list
[EMAIL PROTECTED]
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Using awk or perl to find and replace

2004-11-23 Thread Trevor M. Lango
I have been reading the man pages and I'm lost.  I want to scan through 
an input file for an expression with this pattern:

    h.*.JPG

and replace it with an expression with the following pattern:

    *.h.JPG

Perl and awk both appear to be ideal candidates for just such a task 
but I'm a serious newbie to both of 'em.  Any help much appreciated!
___
vox-tech mailing list
[EMAIL PROTECTED]
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Slack 10 print problem solved

2004-11-23 Thread wild bill
Thanks again to all for their time, effort and input.  
Thanks especially to Ken Bloom for persevering with finding 
the ultimate solution.  

I don't know why uncommenting the required entries in the 
rc.modprobe file did not work;  but, as Ken suggested, I 
put the modprobe parport_pc and modprobe lp where Slackware 
would find them on startup.  I chose rc.local since it is 
my hack of the problem and it seems to me to be a logical 
choice.  

Manually editing the /edit/cups/printers.conf failed to 
produce print output.  And, the parallel port choice still 
does not show in the http://localhost:631/admin Device 
screen.  However, the KDE printer setup was able to do its 
magic and produced the Cups Printer Test Page.

A document was subsequently printed from ABIWord so at last 
all is well.  

Thanks again to all.

Bill Wells
___
vox-tech mailing list
[EMAIL PROTECTED]
http://lists.lugod.org/mailman/listinfo/vox-tech