Reputation: 2849
Want to add a forward slash to the beginning of each line in a file. Having trouble escaping the character.
Input
// input.txt
hello
world
foo
bar
Expected Output
/hello
/world
/foo
/bar
Command Tried
cat input.txt | sed 's/^/\/\\/'
Output of Command Tried
/\hello
/\world
/\foo
/\bar
Any insights is appreciated
Upvotes: 3
Views: 1059