Project

General

Profile

Bug #392

Sed -i Not Working on FreeBSD

Added by Daniel Curtis over 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Command-Line Help
Target version:
Start date:
05/20/2014
Due date:
% Done:

100%

Estimated time:
0.10 h
Spent time:

Description

While doing some common administration with the sed command line tool on FreeBSD, I found that the normal sed command would not work:

sed -i 's/changing/changed/g' /path/to/files/*

  • I found a workaround on the FreeBSD forums that suggested the syntax should look more like the following:
    find . -type f -exec sed -i "" 's/changing/changed/g' {} \;
    
  • To use sed on a single file:
    sed -i '' -e 's/replace/textreplace/g' /path/to/file.txt
    

Resources

Also available in: Atom PDF