I wrote my script using the the folder ~/deleted (its a long script) after using ""~/deleted"" for the whole script I want to let the user choose the directory by putting the path in ~/.rm.cfg
my 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"" with ""$defaultpath"" in my script. is 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