[prev in list] [next in list] [prev in thread] [next in thread]
List: initramfs
Subject: [PATCH 1/5] dracut-lib: add str_ends, to go along with str_starts
From: Will Woods <wwoods () redhat ! com>
Date: 2012-04-05 17:01:35
Message-ID: 1333645299-16837-2-git-send-email-wwoods () redhat ! com
[Download RAW message or body]
---
modules.d/99base/dracut-lib.sh | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index cb2e4dc..1ecd286 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -12,6 +12,11 @@ str_starts() {
[ "${1#$2*}" != "$1" ]
}
+# returns OK if $1 contains $2 at the end
+str_ends() {
+ [ "${1%*$2}" != "$1" ]
+}
+
# replaces all occurrences of 'search' in 'str' with 'replacement'
#
# str_replace str search replacement
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic