When I set up FreeBSD, I followed an online guide that used sed to modify a few conf files. One was like this:
But now while going through a book on sed, I try this on a regular file and get an error.
Some googling shows that some versions of sed require
list.txt
# sed -i 's/datasize-cur=768M/datasize-cur=4096M/' /etc/login.conf
But now while going through a book on sed, I try this on a regular file and get an error.
$ sed -i 's/MA/Mass/' list.txt
sed: 1: "list.txt": extra characters at the end of l command
Some googling shows that some versions of sed require
sed -i ''
-- empty single quotes first. That does work, but if sed requires that on FreeBSD, why didn't it give me the same error when I used it on /etc/login.conf?list.txt
Code:
John Daggett, 341 King Road, Plymouth MA
Alice Ford, 22 East Broadway, Richmond VA
Orville Thomas, 11345 Oak Bridge Road, Tulsa OK
Terry Kalkas, 402 Lans Road, Beaver Falls PA
Eric Adams, 20 Post Road, Sudbury MA
Hubert Sims, 328A Brook Road, Roanoke VA
Amy Wilde, 334 Bayshore Pkwy, Mountain View CA
Sal Carpenter, 73 6th Street, Boston MA