summaryrefslogtreecommitdiffstats
path: root/helper/string.inc
diff options
context:
space:
mode:
authorJonathan Bauer2013-04-17 16:25:38 +0200
committerJonathan Bauer2013-04-17 16:25:38 +0200
commita8b11556ccee779ba5bc988d3efae16f4d68b174 (patch)
tree30b722408f67d03a1adf1be3ceccb4e33b05443a /helper/string.inc
parentdelete symlink.. (diff)
downloadtm-scripts-a8b11556ccee779ba5bc988d3efae16f4d68b174.tar.gz
tm-scripts-a8b11556ccee779ba5bc988d3efae16f4d68b174.tar.xz
tm-scripts-a8b11556ccee779ba5bc988d3efae16f4d68b174.zip
kernel compile preparations
Diffstat (limited to 'helper/string.inc')
-rw-r--r--helper/string.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/helper/string.inc b/helper/string.inc
index 0a166708..9f18e4e0 100644
--- a/helper/string.inc
+++ b/helper/string.inc
@@ -12,3 +12,12 @@ trim() {
canonicalize() {
cd -P -- "$(dirname -- "$1")" && printf '%s\n' "$(pwd -P)/$(basename -- "$1")"
}
+
+escape_search() {
+ sed -e 's/[]\/()$*.^|[]/\\&/g'
+
+}
+
+escape_replace() {
+ sed -e 's/[\/&]/\\&/g'
+}