- Joined
- Nov 4, 2011
- Messages
- 4
- Reaction score
- 0
- Points
- 1
Hi,
I have a question on Terminal 2.2.1.
I have a text file, tmp.txt, with these contents:
abc
blah
efg
I am trying to understand why the following command doesn't work (to replace 'blah' with 'the'). It works fine in both bash and tcsh in linux. Perhaps there is something different going on with quotes in Terminal?
>$ sed -i '2s/blah/the/' tmp.txt
sed: 1: "tmp.txt": undefined label 'mp.txt'
Does anyone know alternative syntax to make this work in Mac Terminal?
Any help would be greatly appreciated!,
Will
P.S. This works fine, but I want to use 'sed -i' to make the change:
>$ sed '2s/blah/the/' < tmp.txt
abc
the
efg
I have a question on Terminal 2.2.1.
I have a text file, tmp.txt, with these contents:
abc
blah
efg
I am trying to understand why the following command doesn't work (to replace 'blah' with 'the'). It works fine in both bash and tcsh in linux. Perhaps there is something different going on with quotes in Terminal?
>$ sed -i '2s/blah/the/' tmp.txt
sed: 1: "tmp.txt": undefined label 'mp.txt'
Does anyone know alternative syntax to make this work in Mac Terminal?
Any help would be greatly appreciated!,
Will
P.S. This works fine, but I want to use 'sed -i' to make the change:
>$ sed '2s/blah/the/' < tmp.txt
abc
the
efg