Browse Source

add func dtscr, not works

pull/1/head
10sr 11 years ago
parent
commit
6241450e42
1 changed files with 22 additions and 0 deletions
  1. +22
    -0
      bashrc

+ 22
- 0
bashrc View File

@@ -549,6 +549,28 @@ scr(){
__MY_SCRIPT=${_file} script ${_file} "$@"
}

dtscr(){
# dtscr <command ...>
if test -z "$1"
then
echo "dtscr: usage: dtscr <command ...>"
return 1
fi

local _cmdstr="`echo $@ | tr ' ' +`"
local _tformat="%Y%m%d-%H%M%S%z"
local _name="${pf}`date +${_tformat}`-${_cmdstr}"

local _scr_file="${HOME}/${_name}.script"

local _dt_dir="${TMP}/dtscr"
install -d "$_dt_dir"

dtach -n "${_dt_dir}/${_name}" script "${_scr_file_}" "$@"
# echo $_name
# echo $_file
}

mcrypt-stream(){
test $# -eq 2 || return 1
case $1 in


Loading…
Cancel
Save