quickshiftin / mysqlbkup

Lightweight MySQL backup script in BASH
GNU Lesser General Public License v3.0
157 stars 70 forks source link

sed command (line 240) #2

Closed ryanyakich closed 10 years ago

ryanyakich commented 10 years ago

I had a problem on mac using the "-r" flag on line 240

240-yours: dbs=$(echo $dbs | sed -r 's/(Database |information_schema |performance_schema )//g')

240-mine: dbs=$(echo $dbs | sed -e s/Database//g -e s/information_schema//g -e s/mysql//g)

quickshiftin commented 10 years ago

It looks like the ERE flag for the Mac version of sed is -E per the manpage.

 -E      Interpret regular expressions as extended (modern) regular expressions rather than basic regular expressions (BRE's).  The re_format(7) manual page fully describes both formats.

Can you verify this works? dbs=$(echo $dbs | sed -E s/Database//g -e s/information_schema//g -e s/mysql//g)

Also note that I stated the script only works for GNU. I'll be happy to start hacking in support for other platforms though.

ryanyakich commented 10 years ago

The script worked great on my mac as well as on Dreamhost server after I made this change as well as the change to the $HOST check.

quickshiftin commented 10 years ago

Ok, I've got a patch for sed on OSX up on master, let me know if it works for you.

ryanyakich commented 10 years ago

Worked great. Thank you.