Skip to main content
added 1 character in body
Source Link
YoMismo
  • 4.1k
  • 1
  • 18
  • 31

You just need to treat filename adding an escape caracter \ before the space.

filename=$(echo $i|sed 's/ /\\ /'g') mv $filename $new_filename 

You just need to treat filename adding an escape caracter \ before the space.

filename=$(echo $i|sed 's/ /\\ /') mv $filename $new_filename 

You just need to treat filename adding an escape caracter \ before the space.

filename=$(echo $i|sed 's/ /\\ /g') mv $filename $new_filename 
Source Link
YoMismo
  • 4.1k
  • 1
  • 18
  • 31

You just need to treat filename adding an escape caracter \ before the space.

filename=$(echo $i|sed 's/ /\\ /') mv $filename $new_filename