'i am trying to add http:// to a serious of files. I keep getting this error sed: -e expression #1, char 15: unknown option to `s' when using sed

The command worked for my boss yesterday. The only difference is he is on a mac. Originally I thought it was a copy/past issue, but I still get the error when I type it by hand.

The command I am using is :

sed -i -e 's/^/http:\/\//'filename.txt

This is all being done on a Ec2 instance. And I am using vs code to connect.



Solution 1:[1]

Use

sed -i'.bak' -e 's/^/http:\/\//' filename.txt

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ryszard Czech