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

#1

Updated by Daniel Curtis over 10 years ago

  • Status changed from Resolved to Closed
#2

Updated by Daniel Curtis almost 10 years ago

  • Target version set to FreeBSD 9
#3

Updated by Daniel Curtis almost 10 years ago

  • Description updated (diff)
  • Category set to Command-Line Help

Also available in: Atom PDF