Q:

I want to copy my present working directory location into abc.text file by replacing some sentence

I want to copy my present working directory location into abc.text file by replacing some sentence.
For example, 4th line of abc.text is "my name is narender" and i want replace pwd path instead of "my name is narender". please help

A:

Using sed for in-place replacement.
$ sed -i "s|replace me|$PWD|g" text.txt

(remember that characters in the $variable will interfere with the sed expression).
sed option:

-i[suffix]Edit files in place (makes backup if SUFFIX supplied).

bash variables:

$PWDThe current working directory as set by the cd command.

Further reading:
Is it possible to escape regex metacharacters reliably with sed

