The most straightforward method to edit a file using a command is by means of the sed editor. If you're already familiar with it, take in mind you can edit the file in place using the option -i. But always do a backup copy of your original file, until you're sure the result is exactly as your expectations. sed permits to do this automatically, just by adding a suffix to the option -i, e.g.
Code:
sed -i.bck <sed command here> file
will create a backup copy named file.bck, before editing file. Maybe you already know all of this, but it's worth to mention for safety.
Regarding your question, using sed you can just address the lines containing the keyword "kernel" at the beginning and add " acpi=force" at the end. For example:
Code:
sed '/^kernel/ s/$/ apci=force/' menu.lst
Don't forget the space before "apci".
Edit: too late... sorry for redundancy. Pixellany, I envy your ability to be clear and succinct...
