I wrote my script using the the folder ~/deleteddirectory ~/deleted (itsit's a long script). after using ""~/deleted""~/deleted for the whole script. I want to let the user choose the directory by putting the path in ~/.rm~/.rm.cfg.cfg
myMy file starts like this:
#!/bin/bash
defaultpath=~/deleted
if [ -s ~/.rm.cfg ]
then
defaultpath=$(head -1 ~/.rm.cfg)
fi
I need to replace every ""~/deleted""~/deleted with ""$defaultpath""$defaultpath in my script. isIs there a way to do it in command line such that it saves and replaces the original file?
I can't get either perl or sed to work.