This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOST=$1 | |
USER=$2 | |
PASS=$3 | |
DATABASE=$4 | |
TABLE=$5 | |
# head/tail to get the second line. The first column is the table, so we delete everything afterwards. | |
mysql -h $HOST -u $USER --password=$PASS $DATABASE -e 'show columns from '"$TABLE"' where `Key`="Pri";'| head -2 |tail -1|sed "s/\t.*//g" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RDSHOST=$1 | |
RDSUSER=$2 | |
RDSPASS=$3 | |
RDSDB=$4 | |
PGHOST=$5 | |
PGUSER=$6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOST=$1 | |
USER=$2 | |
PASS=$3 | |
TABLE=$4 | |
KEY=$5 | |
# head/tail to get the second line. The first column is the field, so we delete everything afterwards. | |
mysql -h $HOST -u $USER --password=$PASS sw -e 'select '"$KEY"' from '"$TABLE"' order by '"$KEY"' desc limit 1'| head -2 |tail -1|sed "s/\t.*//g" |