]> git.nbdom.net Git - nb.git/commitdiff
nb-mails
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 19 Feb 2015 23:52:43 +0000 (23:52 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 19 Feb 2015 23:52:43 +0000 (23:52 +0000)
etc/bashrc.function

index 778bee52617f2fb5f134f1ac7b265d1f3fa560bc..8cc10cb09bf81c3a7c85d22875e303a7ee33e988 100644 (file)
@@ -24,6 +24,11 @@ case "$OSTYPE" in darwin*)
 
 esac
 
+nb-mails() {
+  printf 'f *\nx\n' | mail |  perl -e '@_=<>; shift @_; print shift @_; print reverse @_'
+}
+
+nb-git-create() {
 # NB 19.02.15 root@pi:puppet# nb-git-create puppet/data
 # NB 19.02.15 Initialized empty Git repository in /home/git/puppet/data.git/
 # NB 19.02.15 Cloning into 'data'...
@@ -43,7 +48,6 @@ esac
 # NB 19.02.15 fatal: remote origin already exists.
 # NB 19.02.15 Branch master set up to track remote branch master from origin.
 # NB 19.02.15 Everything up-to-date
-function nb-git-create() {
   declare name="${1%.git}"
   declare dir=$(basename $name)
   declare repo='git@git.nbdom.net'
@@ -80,7 +84,7 @@ DESCRIPTION
   git remote add origin $repo:${name}.git
 }
 
-function nb-git-clone() {
+nb-git-clone() {
   git clone git@git.nbdom.net:${1%.git}.git
 }
 
@@ -111,15 +115,15 @@ env-add-path() {
   echo "$env_value"
 }
 
-function realpath() {
+realpath() {
   perl -MFile::Spec -MCwd -e 'print File::Spec->rel2abs( Cwd::abs_path($ARGV[0]) )."\n"' $1
 }
 
-function ascii() {
+ascii() {
   perl -e 'binmode(STDOUT, ":utf8"); for(32..255){ print "$_:".chr($_)."\n"; }'
 }
 
-function psmem() {
+psmem() {
   #ps -C $1 -O rss | xargs -r cat | gawk '\
   #ps -p `pgrep -f $1` -O rss 2>/dev/null| xargs -r | gawk '\
   ps=`ps ax -O rss 2>/dev/null`
@@ -136,7 +140,7 @@ END {
   return
 }
 
-function unzipurl() {
+unzipurl() {
    declare url=$1
    #declare file=`echo "$url"|sed 's,^.*?\([^/]+\.zip\)$,\1,'`
    declare file=`echo "$url"|awk -F/ '/\.zip$/ { print $NF }'`
@@ -146,7 +150,7 @@ function unzipurl() {
    rm "$file"
 }
 
-function bytes2h() {
+bytes2h() {
   declare in="cat" args=""
   if [ "$1" == "-regex" ]; then
     args="regex=$2"