소스 검색

bashrc: add func dt

pull/1/head
10sr 10 년 전
부모
커밋
0ea564f112
1개의 변경된 파일25개의 추가작업 그리고 0개의 파일을 삭제
  1. +25
    -0
      bashrc

+ 25
- 0
bashrc 파일 보기

@@ -397,6 +397,31 @@ man(){
man "$@"
}

dt(){
# dt <name> [<command ...>]
if test -z "$1"
then
echo "dt: usage: dt <name> [<command ...>]" 1>&2
return 1
fi
soc_name="$1"
shift
if test -S "$soc_name"
then
dtach -a "$soc_name"
elif test -e "$soc_name"
then
echo "dt: File named $soc_name already exists."
return 1
elif test -z "$1"
then
echo "dt: Socket named $soc_name not exists and no command specified."
return 1
else
dtach -c "$soc_name" -e ^^ "$@"
fi
}

scr(){
test -n "$1" && pf="${1}-"
local _tformat="%Y%m%d-%H%M%S%z"


불러오는 중...
취소
저장