How can i use sed to change "Linux Cpu (EDF).sh" to "LinuxCpuEDF.sh"?
I want to replace the spaces and brackets.
Try this:
sed 's/[ ()]//g'
Thanks, it worked.
But i want to change the value of the string permanently.
Assuming you want to change the value of the variable:
string="Linux Cpu (EDF).sh"
string=$(echo "$string" | sed 's/[ ()]//g')
Assuming the variable is a file and you want to rename the file:
string="Linux Cpu (EDF).sh"
mv $string $(echo "$string" | sed 's/[ ()]//g')
something like this :
str="Linux Cpu (EDF).sh"
str=`echo $str | sed 's/[ ()]//g'`
echo $str