Find the answer to your Linux question:
Results 1 to 3 of 3
Hey! Could I get some help as well? Im trying to change this File :/boot/grub/menu.lst replace : default 1 with : default 0 so I type in sudo sed 's/default ...
  1. #1
    Just Joined!
    Join Date
    Jun 2007
    Posts
    1

    Could I get some help?

    Hey!
    Could I get some help as well?
    Im trying to change this

    File:/boot/grub/menu.lst
    replace: default 1
    with: default 0

    so I type in
    sudo sed 's/default 1/default 0/' /boot/grub/menu.lst

    and it does't give me any errors, but it isn't changing it!

    Any help, wouldn't go a miss!
    Saying thanks now!

  2. #2
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    because you have not saved it?
    check whether your sed supports the -i option, if not redirect the sed to an temp output file, then rename it back to original.

  3. #3
    Just Joined! Sivel's Avatar
    Join Date
    Jun 2005
    Location
    Maryland
    Posts
    20
    You can do this using perl without having to redirect the output

    Code:
    perl -pi -e 's/default\ 1/default\ 0/' /boot/grub/menu.lst
    or as ghostdog74 said you can use sed -i which will edit the file in place.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...