Skip to content

Instantly share code, notes, and snippets.

View dakshhmehta's full-sized avatar
💭
Enjoy the Coding!

Daksh Mehta dakshhmehta

💭
Enjoy the Coding!
View GitHub Profile
# > /dev/null is disable the outputs of the commands
if [ $# -eq 0 ]; then
echo "Provide the PHP version to enable"
exit 0
fi
for php in 5.6 7.1 7.2 7.3
do
if [ $php == $1 ]
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite