[Sussex] Sed One Liner

John Crowhurst info at johnscomputersupport.co.uk
Sat Aug 16 19:12:58 UTC 2008


On Sat, August 16, 2008 16:59, John Patrick wrote:

> $ sed "s/`pwd`/ROOT_DIR/g" TEST > TEST
> $ sed "s/$PWD/ROOT_DIR/g" TEST > TEST

Firstly: sed s/search/replace/

Secondly, don't use / with ", use |

$ sed "s|ROOT_DIR|`pwd`|g" TEST > TEST
$ sed "s|ROOT_DIR|$PWD|g" TEST > TEST


-- 
John Crowhurst
John's Computer Support




More information about the Sussex mailing list