Restructure functions
This commit is contained in:
@@ -1,28 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
function grepmysql () {
|
||||
if [[ -z "$1" ]]; then
|
||||
__func_head "MySQL_SERVER_NAME [WITH_OPTIONS]"
|
||||
echo
|
||||
else
|
||||
if [[ -z "$2" ]]; then
|
||||
grep -i $1 ~/.mysql_pass | awk 'BEGIN{FS=":"}{ print $2 }'
|
||||
else
|
||||
grep -i $1 ~/.mysql_pass | awk 'BEGIN{FS=":"}{ print $2" "$3 }'
|
||||
fi
|
||||
fi
|
||||
}
|
||||
alias grepphp='grep -n --include=*.php'
|
||||
alias grepjs='grep -n --include=*.js'
|
||||
|
||||
function grepdb () {
|
||||
if [[ -z "$1" ]]; then
|
||||
__func_head "DB_NAME"
|
||||
echo
|
||||
else
|
||||
grep $1 ~/.db_pass | awk 'BEGIN{FS=":"}{ print $2 }'
|
||||
fi
|
||||
}
|
||||
|
||||
function greptype() {
|
||||
function grept {
|
||||
if [[ -z "$1" ]]; then
|
||||
__func_head "TYPE GREP_ARGS"
|
||||
echo
|
||||
|
Reference in New Issue
Block a user