]> git.nbdom.net Git - nb.git/commitdiff
bashrc*
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 7 Feb 2015 13:16:45 +0000 (13:16 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 7 Feb 2015 13:16:45 +0000 (13:16 +0000)
etc/bashrc
etc/bashrc.alias
etc/bashrc.function

index 2ab34643917451e768812d319378cc0dd02c4351..45a7ec95785c76e7f01e11cd248eab6c79a2fb4d 100644 (file)
@@ -1,16 +1,19 @@
-. "${BASH_SOURCE%/*}/bashrc.function"
-. "${BASH_SOURCE%/*}/bashrc.alias"
 #################################################################################
 #
 # ENVS
 #
 #################################################################################
-NB_ROOT=$(realpath ${BASH_SOURCE%/*}/..)
 [ -z "$HOSTNAME" ] && HOSTNAME=`hostname`
 [ -z "$UID" ] && UID=`id -u`
 [ -z "$USER" ] && USER=`whoami`
+
+. "${BASH_SOURCE%/*}/bashrc.function"
+
+NB_ROOT=$(realpath ${BASH_SOURCE%/*}/..)
 [ -z "$HOME" ] && HOME=`realpath ~/`
 
+. "${BASH_SOURCE%/*}/bashrc.alias"
+
 #
 # PATH
 #
index e0675848bd01e6d559cd46da882a8ce3f38e2f68..93b4547657b8704ef5a57e9ad8e3e0c72097f6d1 100644 (file)
@@ -14,6 +14,7 @@ alias password-gener='apg -m 12 -x 12 -a 0 -M L|head -1;'
 alias mysqlshow-view="mysql -e \"SHOW FULL TABLES WHERE TABLE_TYPE LIKE 'VIEW'\""
 alias nmap-ping="nmap -sP -PE -PS443 -PA21,22,23,80,3389"
 alias arp-list="arp -an"
+[ "$USER" != "postgres" ] && alias psql='sudo -u postgres psql'
 
 #--------------------------------------------------------------------------------
 # Etherwake
index f0fe6c525ef256888aad21193c80d9cc51e54f43..20643597447824d275ab106616fbef077767e36f 100644 (file)
@@ -83,7 +83,7 @@ env-add-path() {
 }
 
 function realpath() {
-  perl -MFile::Spec -MCwd -e 'print File::Spec->rel2abs( Cwd::abs_path($ARGV[0]) )' $1
+  perl -MFile::Spec -MCwd -e 'print File::Spec->rel2abs( Cwd::abs_path($ARGV[0]) )."\n"' $1
 }
 
 function ascii() {