Quote:
Originally Posted by shiroh_1982
If you give :
sed 's/01514581/01514582/' test
where 'test' is the filename
then the output is not getting saved into the file 'test'..
|
The editing is not in place. I mean, the original file remains intact and a new one must be created. sed is supposed to be used as a "filter", not as a in-place editor.
Create a copy of test, use the copy as input to sed, and send the modified stream to test.
Code:
$ cp test test.original
$ sed 's/01514581/01514582/' test.original > test
Quote:
Originally Posted by shiroh_1982
The output does not recognise $p
|
Thats mean $p was not set in the proper way. If you are using bash:
Code:
$ p="test"
$ echo $p
test
$ q="${p}.original"
$ sed 's/01514581/01514582/' $q > $p