From 999ebad51184a5ac10890ec7818123ee57e63e3d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 4 Oct 2013 16:11:09 +0900 Subject: [PATCH 1/3] use datenum to tb path --- bashrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index c02adf2..013ad55 100755 --- a/bashrc +++ b/bashrc @@ -688,7 +688,8 @@ di(){ } tb(){ - local tb="$HOME/.my/tb" + local datenum=`date +%Y%m%d-%H%M%S` + local tb="$HOME/.my/tb/$datenum" mkdir -p "$tb" for file in "$@" do From 05834debdbe4ef24770967b695164a7a39a90323 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 4 Oct 2013 21:59:43 +0900 Subject: [PATCH 2/3] add func datestr --- bashrc | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index c02adf2..d049610 100755 --- a/bashrc +++ b/bashrc @@ -338,12 +338,66 @@ then || complete -o default -o nospace -F _git g fi git svn --help >/dev/null 2>&1 && alias gsvn="git svn" -null type gitmemo && alias m=gitmemo null type gitmemo && alias m=gitmemo alias setup.py="sudo python3 setup.py install --record files.txt" +datestr(){ + # datestr yyyyMMdd-hhmmss + if test -z "$1" || test "$1" == "-h" + then + echo "datestr: usage: datestr " + return 1 + fi + + dfmt= # actual format for date command + while test -n "$1" + do + fmt="$1" + while test -n "$fmt" + do + case "$fmt" in + yyyy*) # year + dfmt="${dfmt}%Y" + fmt="`echo "$fmt" | cut -c 5-`" + ;; + yy*) # last two digits of year + dfmt="${dfmt}%y" + fmt="`echo "$fmt" | cut -c 3-`" + ;; + MM*) # month (01..12) + dfmt="${dfmt}%m" + fmt="`echo "$fmt" | cut -c 3-`" + ;; + dd*) # day of month (01..12) + dfmt="${dfmt}%d" + fmt="`echo "$fmt" | cut -c 3-`" + ;; + HH* | hh*) # hour (00..23) + dfmt="${dfmt}%H" + fmt="`echo "$fmt" | cut -c 3-`" + ;; + mm*) # minute (00..59) + dfmt="${dfmt}%M" + fmt="`echo "$fmt" | cut -c 3-`" + ;; + ss*) # second (00..60) + dfmt="${dfmt}%S" + fmt="`echo "$fmt" | cut -c 3-`" + ;; + *) + char=`echo "$fmt" | cut -c 1` + dfmt="${dfmt}${char}" + fmt="`echo "$fmt" | cut -c 2-`" + ;; + esac + done + shift + done + date +"$dfmt" +} + ssh(){ __my_set_screen_title ssh command ssh "$@" From 6835117704870cc2e859886fb62b9151607ce036 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 6 Oct 2013 18:54:09 +0900 Subject: [PATCH 3/3] update README --- README.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.txt b/README.txt index 07aee7d..cece316 100644 --- a/README.txt +++ b/README.txt @@ -10,16 +10,16 @@ __Do not go out of ways how the default environments work__. There are many cases when I must work on foreign environments, and it is always -VERY irritating when things will not work as I expect, yet setting up my own -environment will be troublesome. So I avoid changing behaviors of tools, -except for emacs. +VERY irritating when things do not work as I expected, yet setting up my own +environment is troublesome. So I avoid changing behaviors of tools, except +for emacs. Emacs is the editor I usually use for coding. I decided to change the behavior of emacs as I want without thinking about other environments. When I cannot use my emacs.el I'll use vi or vim instead. Other tools like bash and vim basically work in the same ways even when using my -rc files. The main changes are related to showing informations, typically the +rc files. The main changes are related to showing informations, typically in the bash prompt. @@ -41,4 +41,3 @@ Sourcing flow |--~/.dotfiles/xprofile | `--~/.dotfiles/xprograms -