[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] replace patterns in empty strings
From: |
isabella parakiss |
Subject: |
Re: [PATCH] replace patterns in empty strings |
Date: |
Thu, 7 May 2015 05:16:10 +0200 |
Sorry, the previous patch was wrong, it enters an endless loop when
replacing all the occurrencies in ${var//pat/rep}
Attached the correct one (I think).
Tests:
$ ./bash -c 'var=; echo "${var/#/x}"'
x
$ ./bash -c 'var=; echo "${var/*/x}"'
x
$ ./bash -c 'var=; echo "${var//*/x}"'
x
$ ./bash -c 'var=abc; echo "${var/#/x}"'
xabc
$ ./bash -c 'var=abc; echo "${var/*/x}"'
x
$ ./bash -c 'var=abc; echo "${var//*/x}"'
x
This behaviour is consistent with ksh.
Sorry for the trouble...
---
xoxo iza
corrected-0001-replace-patterns-in-empty-strings.patch
Description: Binary data