Monday, September 1, 2014

sed: 1: extra characters at the end of d command in OSX

 git:(development) ✗ sed -i "s/mnt/fstab/g" *  
 sed: 1: "hostname.yaml": extra characters at the end of d command  

To fix this, you need to specify a backup file

 git:(development) ✗ sed -i .back "s/mnt/fstab/g" *  

Then remove the backup files

 rm -f *.back   

ref: http://stackoverflow.com/questions/4247068/sed-command-failing-on-mac-but-works-on-linux

No comments:

Post a Comment