bug-bash
[Top][All Lists]
Advanced

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

Re: how do I split variables?


From: Chet Ramey
Subject: Re: how do I split variables?
Date: Fri, 22 Sep 2000 14:38:03 -0400

> In article <8qf7a1$gq3$1@news.online.de>, "Kjeld Peters" <ich@kjeld.de> 
> writes:
> |> 
> |> I'm having some trouble with a script:
> |> 
> |> $FILE (contains recvq/fax00044.tif, for example. the number rises by 1,
> |> everytime a fax is             recieved)
> |> I want to change the value of $FILE(recvq/fax00044.tif) to
> |> recvq/someuser/fax00044.tif.....
> |> Since there is no way to change $FILE's value, there must be some special
> |> wordsplit function or so........
> 
>    Why is there no way to change $FILEs values?
> 
>    $FILE =~ s|(/fax\d+\.tif)$|/someuser$1|;
> 
> ie: change /faxnnnn.tif to /someuser + what_was_matched, making sure you
> match at end of line (or string).

There is:  assignment.  Bash doesn't have the flexible regexp-based
substitution syntax that perl does, but this is certainly possible.
Look at my previous response.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


reply via email to

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