in the bash script file, I set one variable as follows:
current_path=`pwd`
sed -i "1s/.*/working_path='$current_path';/" file1.sh
I want to run this script, to replace the first line file1.shon working_path='$current_path';, but current_pathis /part of a team sed, /predestined to sedreplace the template. And I tried this:
current_path1="${current_path/\//\\\/}"
the above line, I want to replace /the variable current_pathwith \/, then enter current_path1the command sed, but also has an error.
Could you give me some advice please? Thanks.
source
share