I have a bucket on GCP cloud storage and I want to rename all files that have a white space in their filename to the name where the whitespace is removed by a hyphen (-).
I tried something like
gsutil ls gs://<bucket>/<folder_with_the_files_to_rename>/ | sed 's/ /-/g/gsutil mv & \1/'
Unfortunately, I cant get the sed command work to replace the whitespace and then use the gsutil mv command to actually rename the file.
Can someone help me?