For the following scripts,
cmdline="root=/dev/mapper/rhel-root rd.lvm.lv=rhel/root quiet"
remove_cmdline_param $cmdline "root"
we will get the result "rd.lvm.lv=rhel/ quiet", after this patch
we can get the correct "rd.lvm.lv=rhel/root quiet".
Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
---
kdumpctl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 4d68be0..b9ff268 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -69,7 +69,8 @@ remove_cmdline_param()
for arg in $@; do
cmdline=`echo $cmdline | \
sed -e "s/\b$arg=[^ ]*\b//g" \
- -e "s/\b$arg\b//g" \
+ -e "s/^$arg\b//g" \
+ -e "s/[[:space:]]$arg\b//g" \
-e "s/\s\+/ /g"`
done
echo $cmdline
--
1.8.3.1