andreafabrizi / Dropbox-Uploader

Dropbox Uploader is a BASH script which can be used to upload, download, list or delete files from Dropbox, an online file sharing, synchronization and backup service.
https://www.andreafabrizi.it/2016/01/01/Dropbox-Uploader/
GNU General Public License v3.0
6.56k stars 1.08k forks source link

sed: 1: "s/\([0-9A-F]\{2\}\)/\\\ ...": bad flag in substitute command: 'I' #378

Open jpage4500 opened 7 years ago

jpage4500 commented 7 years ago

Just started seeing this error. The file uploads fine which is strange.. but wanted to mention it anyway

sed: 1: "s/\([0-9A-F]\{2\}\)/\\\ ...": bad flag in substitute command: 'I'
 > Uploading "/tmp/version.txt" to "/version.txt"... DONE

I'm calling the script like this:

    echo "Version $VERSION" > /tmp/version.txt
    ./dropbox_uploader.sh -f .dropbox_uploader upload /tmp/version.txt version.txt
dzajkowski commented 7 years ago

What's happening: https://stackoverflow.com/questions/4412945/case-insensitive-search-replace-with-sed

Where: function db_sha_local echo $SHA_CONCAT | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI'

I tried replacing sed with gsed and it fixes the error message but it looks like the hashes never match. Need to investigate more.

zzymyn commented 7 years ago

Can fix by making the change: #404

tjluoma commented 6 years ago

FYI - I am seeing this with Dropbox Uploader v1.0 if I try to upload a file that already exists on Dropbox.

For example, if '/Sites/iusethis.luo.ma/trickster/Trickster-2.8_2800.zip' already exists:

dropbox_uploader.sh -p upload Trickster-2.8_2800.zip /Sites/iusethis.luo.ma/trickster/Trickster-2.8_2800.zip

gives this error:

sed: 1: "s/\([0-9A-F]\{2\}\)/\\x ...": bad flag in substitute command: 'I'

before this happens:

 > Uploading "Trickster-2.8_2800.zip" to "/Sites/iusethis.luo.ma/trickster/Trickster-2.8_2800.zip"...
######################################################################## 100.0%
DONE

But it doesn't happen if the file does not exist on Dropbox already.

I hope that helps.

pulberg commented 4 years ago

Any update on getting this resolved?

tjluoma commented 3 years ago

This should be fixed now that pull request https://github.com/andreafabrizi/Dropbox-Uploader/pull/520 has been merged.