Re: newbie sed question

From: jerrygarciuh (designs_at_no.spam.nolaflash.com)
Date: 05/30/04

  • Next message: jerrygarciuh: "Re: newbie sed question"
    Date: Sun, 30 May 2004 10:09:46 -0500
    
    

    Thanks very much! I have a lot to learn about command line scripting!

    jg

    "Måns Rullgård" <mru@kth.se> wrote in message
    news:yw1xd64mcnj6.fsf@kth.se...
    > Lew Pitcher <lpitcher@sympatico.ca> writes:
    >
    > > To do what you should be doing
    > >
    > > ~ for file in `ls -R | grep 'index.php'` ;
    > > ~ do
    > > ~ sed 's/foo/bar/g' $file >$file.xxx
    > > ~ rm $file
    > > ~ mv $file.xxx $file
    > > ~ done
    >
    > Or
    >
    > find . -name index.php | while read file; do
    > sed 's/foo/bar/g' "$file" > "$file.xxx"
    > mv "$file.xxx" "$file"
    > done
    >
    > The quotes are necessary if the name of some directory contains
    > whitespace.
    >
    > --
    > Måns Rullgård
    > mru@kth.se


  • Next message: jerrygarciuh: "Re: newbie sed question"

    Relevant Pages

    • Re: Booming or Fuming? Are You Alive? Or Are You Fading Away?!
      ... The single .cmd file which is a Command Library ... consists of ONLY scripting code using ONLY ... every detail of convoluted shell scripting command syntax. ...
      (microsoft.public.win2000.cmdprompt.admin)
    • Re: Booming or Fuming? Are You Alive? Or Are You Fading Away?!
      ... The single .cmd file which is a Command Library ... consists of ONLY scripting code using ONLY ... every detail of convoluted shell scripting command syntax. ...
      (microsoft.public.windowsxp.perform_maintain)
    • [ANN] Ellié Computing Merge 2.1
      ... You need to install the command line tools for that SCC. ... An ECMAScript compatible scripting engine is now included in ECMerge. ... Run on a differentiation, it will now export a textual ...
      (comp.software.shareware.announce)
    • [COMMERCIAL] Ellié Computing Merge 2.1 for Linux
      ... You need to install the command line tools for that SCC. ... An ECMAScript compatible scripting engine is now included in ECMerge. ... Run on a differentiation, it will now export a textual ...
      (comp.os.linux.announce)
    • Re: Switching from tcsh to bash ...
      ... > see wanting to learn bash and be comfortable using it if you need to. ... > interactive shells, ... Scripting has been bourne sh and ksh, ... I stayed with csh/tcsh mostly because I preferred the ^P command ...
      (comp.sys.mac.system)