Hi ephemeric,
A little late but here's a try with Perl. This is like hippo's solution but it adds the detection of whether the parameter has already been added or not. Personally I don't mind breaking up regexes into several regexes if it helps in thinking about the solution.
perl -pe 's/"\s*$/ transparent_hugepage=never"/ if /^GRUB_CMDLINE_LINU +X=/ && !/transparent_hugepage/' filename
Hope this helps,
-- Hauke D
In reply to Re: GRUB Append Parameter in-between Quotes
by haukex
in thread GRUB Append Parameter in-between Quotes
by ephemeric
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |