Question: sed
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Question: sed

  1. #1
    Join Date
    Mar 2001
    Posts
    286
    Why the file is not changed?

    pksat:[/export/home/oracle/vlai] cat t0605
    test data
    pksat:[/export/home/oracle/vlai] sed 's/data/dxdx/g' t0605
    test dxdx
    pksat:[/export/home/oracle/vlai] cat t0605
    test data

  2. #2
    Join Date
    Feb 2001
    Posts
    123
    Using sed, the changes will be written to standard out. What you need to do is redirect the output to a new file, and then (if required) rename the newly created file to t0605. e.g.

    sed 's/data/dxdx/g' t0605 >temp_t0605
    mv temp_t0605 t0605

    HTH

    David.



Posting Permissions

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



Click Here to Expand Forum to Full Width