From ee524473c85087a16afdf1b9bb4a366819ea6386 Mon Sep 17 00:00:00 2001 From: Baoquan He Date: Thu, 26 Sep 2013 19:35:59 +0800 Subject: [PATCH] kdump-lib.sh: add common function strip_comments Add function strip_comments into kdump-lib.sh, since it's used by several files. Signed-off-by: Wade Mealing Signed-off-by: Baoquan He Acked-by: Vivek Goyal --- kdump-lib.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kdump-lib.sh b/kdump-lib.sh index 1d00f67..4df5315 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -17,3 +17,8 @@ is_raw_dump_target() { grep -q "^raw" /etc/kdump.conf } + +strip_comments() +{ + echo $1 | sed -e 's/\(.*\)#.*/\1/' +}