Results 1 to 7 of 7

Thread: Mass edit files command line

  1. #1
    Join Date
    Jan 2013
    Beans
    15

    Mass edit files command line

    Hey I have a project to do. I have 15 blank .html files. I need to figure a way to place the same text hello in each one. Is there a quick and dirty way? Not using a script but some other way that would work?
    Last edited by bigbankclub; February 12th, 2013 at 03:02 AM. Reason: wrong amount - was 15 not 1500 - typo.

  2. #2
    Join Date
    Jun 2012
    Location
    Sweden
    Beans
    324
    Distro
    Ubuntu 12.04 Precise Pangolin

  3. #3
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Mass edit files command line

    sed or awk?

  4. #4
    Join Date
    Apr 2012
    Beans
    7,154

    Re: Mass edit files command line

    What do you mean by 'blank html'? is there an existing html tag that you are trying to insert a text field into, or are they are actual zero length files?

    If the latter you could maybe do something like

    Code:
    $ tee *.html < <(cat <<EOF
    your
    HTML
    goes
    here
    EOF
    )

  5. #5
    Join Date
    Feb 2013
    Beans
    Hidden!

    Question Re: Mass edit files command line

    @steeldriver. Just wondering, isn't it the same as
    Code:
    tee *.html <<EOF
    your
    HTML
    goes
    here
    EOF

  6. #6
    Join Date
    Oct 2005
    Location
    Al Ain
    Beans
    8,980

    Wink Re: Mass edit files command line

    Since they are all the same, the better way is to make 14 simlinks...

  7. #7
    Join Date
    Apr 2012
    Beans
    7,154

    Re: Mass edit files command line

    Quote Originally Posted by schragge View Post
    @steeldriver. Just wondering, isn't it the same as
    Code:
    tee *.html <<EOF
    your
    HTML
    goes
    here
    EOF
    doh! you're right - I overcomplicated it

Bookmarks

Posting Permissions

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