On Monday 27 March 2017 08:12 AM, Xunlei Pang wrote:
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>
Acked-by: Pratyush Anand <panand(a)redhat.com>
> ---
> kdumpctl | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kdumpctl b/kdumpctl
> index ca97580..e9dc8e5 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -75,7 +75,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
>