Appending a string after a designated test

From: Raqueeb Hassan (raqueebh_at_yahoo.com)
Date: 02/10/04

  • Next message: Alan Connor: "Re: Appending a string after a designated test"
    Date: 9 Feb 2004 21:57:24 -0800
    
    

    Hello there!

    How do I append a string ("<dir>/usr/X11R6/lib/X11/fonts/bangla</dir>"
    say) at the end of a designated line in an existing ASCII text file
    using a Shell Script? Like at first, it will search for a line of
    strings ("<dir>/usr/share/fonts</dir>" say) in a text file. Then it
    will append some texts after that said line.

    Yes, I wanted to modify "/etc/fonts/fonts.conf" with a shell script
    which will look like the modified section below afterwords. Any help
    would be appreciated.

    -----------------Content of Original file----------

    <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>
    <dir>/usr/share/fonts</dir> <------- search for this line and append.
    <dir>~/.fonts</dir>

    --------------Modified Section Below---------------

    <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>
    <dir>/usr/share/fonts</dir>
    <dir>/usr/X11R6/lib/X11/fonts/bangla</dir>
    <dir>~/.fonts</dir>

    Thanks in advance.
    Raqueeb Hassan
    Congo


  • Next message: Alan Connor: "Re: Appending a string after a designated test"

    Relevant Pages

    • Re: Appending a string after a designated test
      ... Raqueeb Hassan wrote: ... > say) at the end of a designated line in an existing ASCII text file ... > using a Shell Script? ... Probably possible via awk too, and there's nearly certainly a simpler ...
      (comp.unix.bsd.freebsd.misc)
    • Re: Appending a string after a designated test
      ... > raqueebh@yahoo.com (Raqueeb Hassan) wrote: ... >> say) at the end of a designated line in an existing ASCII text file ... >> using a Shell Script? ... If it's good enough for BWK, ...
      (comp.unix.programmer)
    • Re: Appending a string after a designated test
      ... > raqueebh@yahoo.com (Raqueeb Hassan) wrote: ... >> say) at the end of a designated line in an existing ASCII text file ... >> using a Shell Script? ... If it's good enough for BWK, ...
      (comp.unix.shell)
    • Re: Appending a string after a designated test
      ... > raqueebh@yahoo.com (Raqueeb Hassan) wrote: ... >> say) at the end of a designated line in an existing ASCII text file ... >> using a Shell Script? ... If it's good enough for BWK, ...
      (comp.unix.questions)
    • Re: Appending a string after a designated test
      ... > raqueebh@yahoo.com (Raqueeb Hassan) wrote: ... >> say) at the end of a designated line in an existing ASCII text file ... >> using a Shell Script? ... If it's good enough for BWK, ...
      (comp.unix.misc)