Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: GRUB Append Parameter in-between Quotes

by haukex (Archbishop)
on Sep 13, 2016 at 15:36 UTC ( [id://1171684]=note: print w/replies, xml ) Need Help??


in reply to GRUB Append Parameter in-between Quotes

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

Replies are listed 'Best First'.
Re^2: GRUB Append Parameter in-between Quotes
by ephemeric (Novice) on Sep 20, 2016 at 09:34 UTC

    Thank you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1171684]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 02:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found