<commit_before>#<?php exit('no access'); ?>
#!/bin/bash

# Run me through bash to start a MySQL client without having to punch in the information from configuration.php

conf="`dirname $0`/configuration.php"
get_var () { grep "var\ \$$1 " $conf | awk '{ print $4 }' | sed "s/^'\|[';]\+$//g"; }

mkfifo -m 600 $HOME/.my.cred
(echo "[client]"; echo -n "password="; get_var "password") > $HOME/.my.cred &
mysql --defaults-extra-file="$HOME/.my.cred" -u `get_var 'user'` `get_var 'db'`
rm $HOME/.my.cred
<commit_msg>fix handling of quotes in variable<commit_after>#<?php exit('no access'); ?>
#!/bin/bash

# Run me through bash to start a MySQL client without having to punch in the information from configuration.php

conf="`dirname $0`/configuration.php"
get_var () { grep "var\ \$$1 " $conf | awk '{ print $4 }' | sed "s/^'\|[';]\+$//g"; }

mkfifo -m 600 $HOME/.my.cred
(echo "[client]"; echo -n "password=\""; get_var "password" | sed "s/$/\"/"; ) > $HOME/.my.cred &
mysql --defaults-extra-file="$HOME/.my.cred" -u `get_var 'user'` `get_var 'db'`
rm $HOME/.my.cred

{'fraction_non_alphanumeric': 0.21971830985915494, 'fraction_numerical': 0.011267605633802818, 'mean_word_length': 3.912442396313364, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '285012', 'n_tokens_mistral': 402, 'n_tokens_neox': 382, 'n_words': 117}