Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/var/bin/mksh
- #-*- Mode: Shell-script;-*-
- set -a # turn on autoexport
- PATH=/bin:/sbin:/usr/bin:/usr/sbin${DISPLAY:+:/usr/X11R6/bin}
- PATH=~/bin:/var/bin:~/l/bin:$PATH:/a/a/sbin:/a/a/bin
- #MANPATH=/usr/X11R6/man:/usr/local/man:/Users/daniel/bsd
- MANPATH=~/l/man:/a/a/man:
- #DYLD_LIBRARY_PATH=/a/a/lib
- DYLD_FALLBACK_LIBRARY_PATH=/a/a/lib
- #DYLD_FALLBACK_LIBRARY_PATH=${HOME}/lib:${HOME}/l/lib:/usr/local/lib:/lib:/usr/lib:/a/a/lib
- #see ~/.MacOSX/environment.plist
- PAGER=most #that's the*lostsouls*version early linux user mod.
- # I really need to get away from this habbit
- EDITOR=ed
- VISUAL=nvi
- #BLOCKSIZE=1k
- umask 022
- HOST="$(hostname)"
- HOSTNAME=${HOST}
- HOSTNAME=gorf
- set +a # turn off autoexport
- HISTFILE=${HOME}/.mksh_history
- HISTSIZE=200
- #PS1="%"
- ##unset ENV # breaks man if set
- unset ENV
- #set -o noclobber
- #ulimit -c 0
- #ulimit -n 1024
- ulimit -c unlimited
- ##### aliases ###############
- #alias prepwd='PATH=$PWD:$PATH'
- #alias oldpwd="PATH=$PATH"
- #alias postpwd='PATH=$PATH:$PWD'
- #alias dropcd='read&&cd $(dirname "$REPLY")'
- #path+ path-
- #saved store PWD into array
- #restored restore from array
- alias doy="date '+%j'"
- alias ydoy="date '+%j%y'"
- alias yydoy="date '+%j%Y'"
- alias vdt="date '+%v'"
- alias dt="date '+%D %r'"
- alias dt0="date '+%D'"
- alias dt1="date '+%r'"
- alias isodate="date '+%G-%m-%d'"
- alias isodt="date '+%G-%m-%d %H:%M'"
- alias isodts="date '+%G-%m-%d %H:%M:%S'"
- alias extcd='drutil -drive external'
- #alias enter="eject -l"
- alias ethers="arp -a | sed -n '{
- s/on .*$//
- s/ (.*) at//
- p
- }'"
- alias a='ls -a'
- alias c='ls -CF'
- alias d0="ls -1p | grep '/$'"
- alias d="ls -1p | sed -n '/\/$/s/^/ /p;'"
- alias dl="ls -lhp | grep '^d'"
- alias DL="ls -lTthp | grep '^d'"
- alias gq='grep -q -- '
- alias g1='grep -m 1 -- '
- alias gg='grep -H -- '
- alias gn='grep -n -- '
- alias ggg='grep -nH -- '
- alias go='grep -Ho -- '
- alias h='grep -h -- '
- alias g=grep
- alias i='grep -iI --mmap -- '
- # above fails when with find . -type d | i patch # seems to be the h?
- alias io='grep -iIo --mmap -- '
- alias ii='grep -iHI --mmap -- '
- alias ir='grep -iHIr --mmap -- '
- alias v='grep -v -- '
- alias f="ls -1p | sed -n '/[^\/]$/s/^/ /p;'"
- alias 0='ls -1fp'
- alias 1=0
- alias t='ls -1ptr'
- alias tt='ls -LTlhrt'
- alias lt='ls -Lgnht'
- alias x='ls -xF'
- alias r='ls -1RF'
- alias r='ls -1RF'
- alias rr='ls -lRF'
- alias R='BLOCKSIZE=1m ls -s1R'
- alias l='ls -lp'
- alias ll='ls -lh'
- alias lll='ls -Llh'
- alias lc='l | sort -n +4'
- alias lm='BLOCKSIZE=1m ls -sF'
- alias lmm='BLOCKSIZE=1m ls -1sSF'
- alias dm='BLOCKSIZE=1m du -c'
- alias bytes="stat -f '%z' "
- alias bytesL="stat -f '%Lz' "
- alias dirs="ls -1Ap | grep '/$' | column"
- alias files="ls -1AF | sed '/[@/]$/d;s/\*$//' |column"
- alias files1="ls -1AF | sed '/[@/]$/d;s/\*$//'"
- alias files2="ls -1F | sed '/[@/]$/d;s/\*$//'"
- alias syms="ls -1AF | grep '@$'"
- alias tree="tree -Ad"
- alias aux='ps aux'
- alias vax='ps vax'
- alias jax='ps jax'
- alias lax='ps lax'
- alias axl='ps axl'
- alias ax='ps ax'
- alias cax='ps cax'
- alias caxl='ps caxl'
- alias pcpu='ps rcxo pcpu,pid,uid,command'
- alias hpcpu='ps rcxo pcpu,pid,uid,command|head'
- alias pmem='ps mxco pmem,pid,uid,command'
- alias ptop='ps mcxo pcpu,pmem,pid,uid,command | head -n $(( LINES - 3 ))'
- alias mem='ps mxco rss,pid,uid,command'
- alias netcat=/usr/bin/nc
- alias 1ping='command ping -qc 1 -t 2'
- alias 0ping='command ping'
- alias vi=nvi
- alias ex=nex
- alias virc='vi ~/.mkshrc'
- alias viewrc='view ~/.mkshrc'
- alias mvi='mv -iv'
- alias hog='BLOCKSIZE=1m du -s *| sort -n'
- alias big='R | grep -v ':$' | sort -n | tail -20'
- alias cpin='cpio -ivmud'
- alias cpout='cpio -ov -H ustar'
- alias cpoutposix='cpio -ovud -H odc'
- alias cplist='cpio -itv'
- alias cpthru='cpio -pvmaud'
- alias cpupdate='cpio -pvmad' ## ???
- alias paxthru0='pax -r -w -0dv -pp --force-local'
- alias usbls='system_profiler SPUSBDataType'
- alias firewirels='system_profiler -detailLevel full SPFireWireDataType'
- alias displayinfo='system_profiler SPDisplaysDataType'
- alias resolution="displayinfo | sed -n '/Resolution:/s/Resolution://p'"
- alias dishz="resolution | sed -n '1s/.* @ //p'"
- alias dismode="displayinfo | sed -n '/Resolution:/{N;s/^ *Resolution://;s/\n *Depth://;y/-@\nC/ c/;p;}'"
- alias dos2unix='tr -d "\015"'
- alias mac2unix='tr "\015" "\012"'
- alias unix2mac='tr "\012" "\015"'
- alias sansnewline='tr -d "\012"'
- ## example ## sed -f iTunesEq.sed < feedin | tr -d "\012" > /tmp/thisfile
- alias shredit='shred -zuvn3'
- alias shred0='shred -zuvn0'
- alias screencap='sleep ${DELAY:-4}; beep 1;screencapture -m /tmp/screencap$(doy).png'
- alias screencapselect='screencapture -iWc'
- alias winsplit='SHELL=/var/bin/mksh window -d -e ^^'
- alias susu='su wheel -c su - -'
- alias typescript='script /tmp/typescript.$$.$(doy)'
- alias typescripta='script -a /tmp/typescript.$(doy)'
- #alias typescriptv='script -a ~vt/typescript.$(doy)'
- alias {}='cat - > /dev/null'
- alias elf='cat - >> elf'
- alias showelf='cat elf'
- alias dwarf='showelf;elf'
- alias dog='{}'
- alias zz='alias -dp;' # directory aliases
- #alias zzz='alias -d ~=$PWD' # alias ~~
- alias zzz='alias -d ~=$OLDPWD' # alias ~~
- alias P='alias -d P=$PWD'
- alias Q='alias -d Q=$PWD'
- alias A='alias -d A=$PWD'
- alias B='alias -d B=$PWD'
- alias C='~/bin/awk/Celsius <<< ' # still need to start line with C or F
- alias ldd='otool -L '
- alias sq3='sqlite3'
- alias patch='patch -b --verbose'
- alias rows="stty -a | sed -n '1{s/^.* baud; //;s/ rows.*columns;$//;p;}'"
- alias stars="tr '\000' '*'< /dev/zero"
- alias stars1="jot -n -b '*' -s '' 0"
- alias stars2="tr -u '\000' '*'< /dev/zero"
- alias agethisyear='echo "You are $(( $(date +\%Y) - ${BIRTHYEAR:-1972 })) this year."'
- alias agedaddied='echo 42. Dad died Nov. 21st 2014'
- alias wireless='LF;CR;tr -dc "[A-Za-z0-9]" < /dev/random | gdd bs=1 count=63 delay=50 2> /dev/null;LF;LF'
- alias fold71='fold -s -w71'
- alias fn='echo $(( $(date +%W) / 2 ))'
- #alias systemlog='syslog -F bsd -l 7,6,5,4,3,2,1 ; syslog -w -F bsd -l 7,6,5,4,3,2,1'
- alias systemlog='(syslog -F bsd ; syslog -w -F bsd)'
- alias word='ispell -S <<<'
- alias starcraft='open -a /Users/daniel/games/Start\ Starcraft.app'
- #
- # decoder ring encryption
- alias hal0="tr '0-45-9AB-Zxyza-w_ ' '5-90-4ZA-Yabcd-z _'"
- alias ibm0="tr '5-90-4ZA-Yabcd-z _' '0-45-9AB-Zxyza-w_ '"
- alias hal="tr '0-45-9AB-Zxyza-w_ \013\213' '5-90-4ZA-Yabcd-z _\213\013'"
- alias ibm="tr '5-90-4ZA-Yabcd-z _\213\013' '0-45-9AB-Zxyza-w_ \013\213'"
- addto(){
- local file="${1}"
- shift || return
- cat - >> "${file}" <<< "$@"
- sofile="${file}"
- }
- alias so='addto ${sofile} $@'
- alias sowhat='print ${sofile-so};cat ${sofile-so};print ${sofile-so};'
- ping(){
- global pingwhat="${1:-$pingwhat}"
- 1ping ${pingwhat:-www.google.com} | sed '2,3{d;};${s/^round-.*=//;y/\// /;}'
- ## can I get out, on the information superhighway?
- ## well, that was a bit of fun, with sed.
- }
- #########functions#############################
- line(){ sed -n ${1:-\$}'{p;q;}' ${2} ;}
- line0(){ sed -n ${1}p ${2} ;}
- lines(){ sed -n ${1},${2}'{p;}' ${3} ;}
- ##a delete alias for things like ping| sed '2,3{d;}' ?
- #peek(){ ls -lh $1 ;head $1 ; cksum $1 ;tail $1 ; }
- peek(){ cksum $1; head $1 ; ls -lh $1 ;tail $1 ; }
- peek2()
- {
- echo -n '### chksum ###' ;cksum $1;
- head $1;
- echo -n '###### '; ls -lh $1;
- tail $1
- }
- altls(){ # alternate between various ls #maybe cls if too down
- local ls="lacltsx" # one of the single letter ls aliases
- integer i="$(( $SECONDS % ${#ls} ))" # no + 1 bc ${var:pos:len} is zero based
- local a
- if (( ${#1} > 0 )) then
- sleep 1.1 # really, we shouldn't hit this branch, but like to know
- command ls "$@"
- elif [[ s = ${ls:$i:1} ]] then
- ls -l | sort -n +4
- else
- #removeremarklater
- a=$(alias "${ls:$i:1}") # grab the alias definition
- a=${a%\'} # remove single ' at end
- a=${a#?\=\'} # remove first char (anychar) = then '
- echo -e "\015\e[A\e[0K${PS4}${a}";$a
- fi
- } # this is breaking and I don't care
- copy(){
- if [[ $# == 0 ]]
- then
- print "Copy what?"
- print " $copy_what"
- fi
- if [[ $# != 1 ]]
- then
- print copy
- print " usage:"
- print " copy filename"
- print " copy /something/filepath/filename"
- print " saves that filename, to copy it later"
- print " copy ."
- print " copies previously select file to where you, presently, are."
- fi
- if [[ '.' == "$1" ]]
- then
- cp -iv "$copy_what" .
- else
- copy_what="$1"
- # not quite done, need to check to see if contains /
- # then add $PWD if not
- # then sanity check by either -f or -r
- # on copy_what
- # if fails then remark and clear it
- fi
- }
- getkey(){ #read a singlekey from the keyboard, put it in $gotkey
- local save
- save=`stty -g` # save tty state
- stty -echo -icanon -isig eof '' # set raw mode
- gotkey=`dd count=1 bs=1 2>/dev/null` # read a single char
- stty $save
- } # originally from my bash2.xx .bashrc, hardly use it these days,
- pressakey(){ # why use the above, when mksh has more features, than original Bourne shell, etc?
- print "Press a key."
- INVISIBLE
- read -rN 1
- INVISIBLENOT
- CR # cosmetic fixup, bc will prompt begins, 1 character out of place, w/o.
- }
- #####
- beep() {
- typeset -i i=${1:-1}
- while (( i > 0 ))
- do
- echo "\a\c"
- (( i = i - 1 ))
- sleep ${beepdelay:-0.6}
- done
- }
- emacsr(){ # resume emacs, passing new args, needs 'resume
- echo "$PWD" "$@" >| ~/.emacs.d/.emacs_args && fg %?emacs
- }
- M(){ #on any BSD you should man ./man.1 etc
- # then Sun went to Solaris --- I should prune this.. should use $@ meh
- for M in $* ;
- do
- nroff -man $M | $PAGER
- done
- }
- ###################
- showchanges(){
- if [ -z $1 ];
- then
- for R in *.~1~ ;
- do
- latest=$(basename $R .~1~ )
- if [ -w $latest ];
- then
- echo "$latest"
- else
- echo -e "$latest \t(!locked)"
- fi
- done
- else
- orig="${1}.~1~";
- if [ ! -f $orig ]; then
- echo $1 has not changed.;
- return 1;
- fi;
- ( echo "$1 (original vs current)" ;
- diff $orig $1 ;
- echo "---- $1 --- " ) | most
- fi
- }
- mkedscript()
- {
- for R in *.~1~;
- do
- latest=$( basename $R .~1~ )
- echo "e $latest"
- diff -e $R $latest
- echo "w"
- done
- echo "q"
- }
- compare2files()
- {
- if [ ! -r "$2" ]; then
- echo NO $2;
- return 2;
- fi;
- if cmp -s $1 $2; then
- echo $1 SAME $2;
- return 0;
- else
- echo "$1 DIFF $2";
- return 1;
- fi
- }
- findexecs(){
- local dir=${1:-.}
- shift
- find $dir -type f -perm -+x "$@"
- }
- # see jot
- yes-n(){ #yes but with echo -n, but strips newline.
- yes $@ | tr -ud '\n'
- }
- mbfree(){
- echo " $(( $(vm_stat | sed -n '2{
- s/^Pages free:[ ]//
- s/.$//
- p
- q
- }') / 256 ))"
- # divide by 256 instead of * 4096 / 1024 / 1024
- }
- commands(){
- local ps_out=$(ps cxo command,pid,start)
- sed 1d <<<${ps_out}| sort -k 1,1
- }
- commandsa(){
- local ps_out=$(ps cAo command,pid)
- sed 1d <<<${ps_out}| sort -k 1,1
- }
- div(){
- echo "$1 div 8 = $(( $1 / 8 )) remainder $(( $1 % 8 )) "
- echo "$2 div 8 = $(( $2 / 8 )) remainder $(( $2 % 8 )) "
- echo ""
- echo "$1 div 16 = $(( $1 / 16 )) remainder $(( $1 % 16 )) "
- echo "$2 div 16 = $(( $2 / 16 )) remainder $(( $2 % 16 )) "
- } #mpeg4 useful
- new(){
- local script=""
- if [[ "finder" == "$1" ]] # make a new terminal window for each finder window
- then
- osascript <<'EOF'
- tell application "Finder"
- get Finder windows
- copy result to Winlist
- repeat with R in Winlist
- get target of R
- get result as string
- get POSIX path of result
- set S to "cd " & result
- tell application "Terminal" to do script S
- end repeat
- end tell
- EOF
- return
- elif [[ -d "$1" ]]
- then
- script="cd ${1}"
- elif [[ -n "$1" ]]
- then
- script="$@"
- elif [[ "${PWD}" != "${HOME}" ]]
- then
- script="cd ${PWD}"
- fi
- osascript -e $'tell app "Terminal" to do script"' -e "$script" -e $'"'
- }
- prompt(){
- case $1 in
- '?'|what)
- print "PS1=$PS1"
- print "PS2=$PS2"
- print "PS3=$PS3"
- print "PS3=$PS4"
- ;;
- ?) # any single character
- PS1="${1} " ;;
- title1|xterm*)
- PS1=']2;${USER}@${HOSTNAME}:${PWD}[${USER}@${HOSTNAME}:${PWD}]
- ]1;${PWD##/*/}%'
- ;;
- title2|rxvt)
- PS1=']2;${USER}@${HOSTNAME}:${PWD}[${USER}@${HOSTNAME}:${PWD}]
- ]1;${HOSTNAME}:${PWD##/*/}%'
- ;;
- min)
- PS1='${PWD##/*/})'
- ;;
- vi)
- PS1='[$?]';;
- root) #datetime#shortdir#
- #PS1=" \$(isodts)#{PWD##/*/}#"
- #PS1="#\$(isodts)#"
- PS1="\$(date '+%T')%"
- ;;
- lost|vt100)
- PS1='>:' ;;
- lost+|dtterm)
- PS1='$?:${PWD##/*/}>:'
- ;;
- lost/)
- PS1='<${PWD##/*/}>:'
- ;;
- lost-|vt102)
- PS1="$?>:"
- ;;
- n*|normal|std)
- PS1='[${USER}@${HOSTNAME}:${PWD}]
- %'
- ;;
- *)
- PS1='%'
- ;;
- esac
- }
- test -x ~/bin/browse.mksh && . ~/bin/browse.mksh
- ## dashboard ####
- alias dashoff='defaults write com.apple.dashboard mcx-disabled -boolean YES ;
- sleep 2 ; killall Dock ; echo Dashboard disabled.'
- alias dashon='defaults write com.apple.dashboard mcx-disabled -boolean NO ;
- sleep 2 ; killall Dock ; echo Dashboard enabled.'
- alias dashp='defaults read com.apple.dashboard mcx-disabled | grep -q 1 &&
- echo Dashboard is disabled. || echo Dashboard is enabled.'
- alias HideDesktop='defaults write com.apple.finder CreateDesktop FALSE ; killall Finder'
- alias ShowDesktop='defaults write com.apple.finder CreateDesktop TRUE ; killall Finder'
- alias dash="osascript - 2>/dev/null<<< 'tell app \"Dashboard\" to activate'"
- ### terminal features #####################
- alias alert='beep 2;dock;beep 1;sleep 1.5;undock;beep 1'
- alias reset="$(whence stty) $(stty -g)||$(whence reset);echo -en '\e<\ec'"
- alias cls="echo -n $(tput clear| vis -o|sed 's/\\/\\\\/g')"
- alias echovtbox="print '\0377'"
- alias echopcbox='echo -e "\0244\c"'
- # cd to Finder , insertion location is where New Folder would happen
- # typically same a target of window 1, works if window 1 is textclipping
- ##alias cdfinder="cd $(osascript -ss -e $'tell app "Finder"\r get insertion location as string\r get POSIX path of result\r end tell' ) "
- ##alias cdil="echo $(osascript -ss -e $'tell app "Finder"\r get insertion location as string\r get POSIX path of result\r end tell' ) "
- mute(){ osascript <<< \
- "set volume output muted (not (get output muted of (get volume settings)))" ; }
- volume(){ # 0 to 100
- local volume
- volume=$(osascript -ss -e $'output volume of (get volume settings)')
- osascript -e "set volume output volume ${1:-$volume}"
- print "volume was $volume" ; }
- pause(){
- osascript <<< 'tell application "iTunes" to if player position is not missing value then playpause'
- }
- skip(){ osascript <<< 'tell application "iTunes" to next track' ; }
- repeat(){ # yeah, I did start merely imitating the existing feature
- case "$1" in
- one|'')
- osascript <<< 'tell application "iTunes" to set song repeat of current playlist to one' ;;
- all)
- osascript <<< 'tell application "iTunes" to set song repeat of current playlist to all' ;;
- off)
- osascript <<< 'tell application "iTunes" to set song repeat of current playlist to off' ;;
- *) print "usage: [one|all|off] " ;;
- esac
- echo -n "Current is playlist is "
- osascript <<< 'tell app "iTunes" to get name of current playlist'
- echo -n "song repeat is "
- osascript <<< 'tell app "iTunes" to get song repeat of current playlist'
- } # use AWK next
- edfile(){ # no, explaination should be necessary, necessarily.
- ed -p '%'"$1"'% ' $1
- }
- ### terminal.app cde term xterm
- undock(){ echo -e "\e[1t\c" ; } # de-iconify
- dock(){ echo -e "\e[2t\c" ; } # iconify
- raise(){ echo -e "\e[5t\c" ; } # also undocks
- lower(){ echo -e "\e[6t\c" ; } # also undocks
- title(){ echo -e "\e]0;$@\a\c" ; }
- bell(){ echo -e "\a\c" ; }
- vtcls(){ echo -e "\e[H\e[J\c" ; } #
- vtsoft(){ echo -e '\e[!p\c' ; } # soft reset
- vtnormal(){ echo -e '\e[0m\c' ; }
- alias n=vtnormal; ## useful if the issue is infact invisible
- #emit(){ echo -en "$@ " ; } # space! meh
- emit(){ echo -e "${1}\c" ; sleep ${2:-0} ; }
- statline(){ # create a???? pragma for purposeful interactive programming
- # yeah, that sounds so stupid, but a year later it still works,
- # it's just I can't improve upon it,----
- # they keyboard that's all.
- # usecase:
- # 0:/tmp>:statline CURSOR 10 Paint
- # will do what
- # 0>/tmp>:cls; CURSOR 10 10; Paint; CURSOR
- # will do, at the commandline prompt
- # Ive been here before
- vtcls
- eval $@
- CURSOR
- }
- vttoggle(){ # possibly a lot of things.. but right now just rev REVVIDEO
- #meh getting bored just set up the switch
- if [[ -z "${vttoggle}" ]]; then
- vttoggle='r'
- fi
- #echo ${vttoggle:0:1}
- if [[ ${vttoggle:0:1} == 'r' ]] then
- echo -e '\e[?5h\c' ;
- vttoggle='R'
- else
- vttoggle='r'
- echo -e '\e[?5l\c' ;
- fi
- set +x
- }
- #alias rm=dd
- ########### pbpaste related
- tweetline(){ pbcopy <<< "$@" ;} #
- alias tweet='cat -uv|pbcopy'
- alias tweetcheck='pbpaste |cat -v;pbpaste | wc; pbpaste| ispell'
- alias comand=command
- alias lastlog='more /var/log/lastlog.log'
- ##alias @cd='cd $(pbpaste <<< "$PWD" )'
- alias emolument='pbcopy <<< emoluments'
- #### XTERM related ########
- icontitile(){ echo -e "\e]1;$*\a\c" ; } # change icon name
- windowtitle(){ echo -e "\e]2;$*\a\c" ; } # change window title
- xproperty(){ echo -e "\e]3;$*\a\c" ; } # set X prop=value #prop to delete
- xcolor(){ echo -e "\e]4;$1;$2\a\c" ; }
- xxcolor(){ echo -e "\e]5;$1;$2\a\c" ; }
- G0(){ echo -e "\017\c" ; } # SI CTRL-O switch to standard character set
- G1(){ echo -e "\016\c" ; } # SO CTRL-N switch to alternate character set
- G2SS(){ echo -e "\eN\c" ; } # SS2 Single Shift Select of G2 character set
- G3SS(){ echo -e "\eO\c" ; } # SS3 Single Shift Select of G3 character set
- CHARSET(){
- case "${1:-default}${2}" in
- default) echo -e '\e%@\c' ;; # Select default character set ISO 8859-1
- utf8) echo -e '\e%G\c' ;; # Select UTF-8 character set (ISO 2022)
- G0|G0ascii) echo -e '\e(B\c' ;; # USASCII
- G0line) echo -e '\e(0\c' ;; # DEC Special Character and Line Drawing Set
- G0soft) echo -e '\e( @\c' ;; # use soft set
- G0?) echo -e "\e(${2}\c" ;; # Designate G0 Character Set
- G1|G1ascii) echo -e '\e)B\c' ;; # USASCII
- G1line) echo -e '\e)0\c' ;; # line drawing
- G1soft) echo -e '\e) @\c' ;; # use soft set
- G1?) echo -e "\e)${2}\c" ;; # Designate G1 Character Set
- G2|G2ascii) echo -e '\e\*B\c' ;;
- G2line) echo -e '\e*0\c' ;;
- G2soft) echo -e '\e* @\c' ;; # use soft set
- G2?) echo -e "\e*${2}\c" ;; # Designate G2 Character Set
- G3|G3ascii) echo -e '\e+B\c' ;;
- G3line) echo -e '\e+0\c' ;;
- G3soft) echo -e '\e+ @\c' ;; # use soft set
- G3?) echo -e "\e\+${2}\c" ;; # Designate G3 Character Set
- vt100) echo -e '\e[?2h\c' ;; # set USASCII for G0-G3 and vt100 mode ???
- esac
- }
- #echo 531
- CR(){ echo -e "\015\c" ; } # carriage return
- LF(){ echo -e "\012\c" ; } # line need or new line
- TABSET(){
- #TABSET col 10 20 30 ...
- #TABSET clear_all
- #TABSET cleartab 20 25 30 ...
- case "${1}" in
- col)
- shift
- for COL in $@
- do
- CURSOR column $COL
- echo -e '\eH\c' # Horizontal Tab Set ## HTS
- done;;
- clear_all)
- echo -e '\e[3g\c' ;; # TBC clear all tabs (works)
- clear_tab)
- shift
- for COL in $@
- do
- CURSOR column $COL
- echo -e '\e[0g\c' # TBC clear tab at current column
- done ;;
- *) echo -e '\eH\c' ;; # Horizontal Tab Set ## HTS
- esac
- }
- SS2(){ echo -e '\eN\c' ; } # Single Shift for one G2 character
- SS3(){ echo -e '\eO\c' ; } # Single Shift for one G3 character
- DOUBLEHEIGHTLINETOP(){ echo -e "\e#3\c" ; } #DECDHL top half
- DOUBLEHEIGHTLINEBOT(){ echo -e "\e#4\c" ; } #DECDHL bottom half
- PRINTDOUBLEHEIGHT(){
- echo -n "$1"
- echo -e "\e#3"
- echo -n "${2:-$1}" # bottom, default 2same, but allow experimentation
- echo -e "\e#4"
- SINGLEWIDTHLINE; # cleanup
- }
- SINGLEWIDTHLINE(){ echo -en "\e#5" ; } #DECSWL
- DOUBLEWIDTHLINE(){ echo -en "\e#6" ; } #DECDWL
- SCREENTEST(){ echo -en "\e#8" ; } #DECALN screen alignmnet test
- NORMAL(){ echo -e '\e[0m\c' ; } # character attributes
- BOLD(){ echo -e '\e[1m\c' ; }
- UNDERLINE(){ echo -e '\e[4m\c' ; }
- BLINK(){ echo -e '\e[5m\c' ; }
- INVERSE(){ echo -e '\e[7m\c' ; }
- INVISIBLE(){ echo -e '\e[8m\c' ; }
- UNDERLINENOT(){ echo -e '\e[24m\c' ; }
- BLINKNOT(){ echo -e '\e[25m\c' ; }
- INVERSENOT(){ echo -e '\e[27m\c' ; }
- INVISIBLENOT(){ echo -e '\e[28m\c' ; }
- BLACK(){ echo -e '\e[30m\c' ; }
- RED(){ echo -e '\e[31m\c' ; }
- GREEN(){ echo -e '\e[32m\c' ; }
- YELLOW(){ echo -e '\e[33m\c' ; }
- BLUE(){ echo -e '\e[34m\c' ; }
- MAGENTA(){ echo -e '\e[35m\c' ; }
- CYAN(){ echo -e '\e[36m\c' ; }
- WHITE(){ echo -e '\e[37m\c' ; }
- COLORFG(){ echo -e "\e[38;5;${1:-0}m\c" ; } # 88/256 color support
- COLORBG(){ echo -e "\e[48;5;${1:-0}m\c" ; } # 88/256 color support
- ORIGINAL(){ echo -e '\e[39m\c' ; }
- BGBLACK(){ echo -e '\e[40m\c' ; }
- BGRED(){ echo -e '\e[41m\c' ; }
- BGGREEN(){ echo -e '\e[42m\c' ; }
- BGYELLOW(){ echo -e '\e[43m\c' ; }
- BGBLUE(){ echo -e '\e[44m\c' ; }
- BGMAGENTA(){ echo -e '\e[45m\c' ; }
- BGCYAN(){ echo -e '\e[46m\c' ; }
- BGWHITE(){ echo -e '\e[47m\c' ; }
- BGORIGINAL(){ echo -e '\e[49m\c' ; }
- HIBLACK(){ echo -e '\e[90m\c' ; }
- HIRED(){ echo -e '\e[91m\c' ; }
- HIGREEN(){ echo -e '\e[92m\c' ; }
- HIYELLOW(){ echo -e '\e[93m\c' ; }
- HIBLUE(){ echo -e '\e[94m\c' ; }
- HIMAGENTA(){ echo -e '\e[95m\c' ; }
- HICYAN(){ echo -e '\e[96m\c' ; }
- HIWHITE(){ echo -e '\e[97m\c' ; }
- BGHIBLACK(){ echo -e '\e[100m\c' ; }
- BGHIRED(){ echo -e '\e[101m\c' ; }
- BGHIGREEN(){ echo -e '\e[102m\c' ; }
- BGHIYELLOW(){ echo -e '\e[103m\c' ; }
- BGHIBLUE(){ echo -e '\e[104m\c' ; }
- BGHIMAGENTA(){ echo -e '\e[105m\c' ; }
- BGHICYAN(){ echo -e '\e[106m\c' ; }
- BGHIWHITE(){ echo -e '\e[107m\c' ; }
- REVVID(){ echo -e '\e[?5h\c' ; } # reverse video (set private mode)
- NORMVID(){ echo -e '\e[?5l\c' ; } # normal video (reset private mode)
- ALTSCREEN(){ echo -e '\e[?47h\c' ; } # alternate screen buffer
- NORMSCREEN(){ echo -e '\e[?47l\c' ; } # use normal screen buffer
- ALTSCREENSC(){ echo -e '\e[?1049h\c' ; } # save cursor+alternate screen buffer
- KEYPADAPP(){ echo -e '\e=\c' ; } #Are these usable?
- KEYPADNORMAL(){ echo -e '\e>\c' ; } #don't seem so # maybe I needed strict-vt set
- SCREENMEMLOCK(){ echo -e '\el\c' ; } #characters above cursor are locked in
- SCREENMEMUNLOCK(){ echo -e '\em\c' ; } ##in place, clear screen undoes also.
- FULLRESET(){ echo -e '\ec\c' ; }
- SOFTRESET(){ echo -e '\e[!p\c' ; }
- REFRESH(){ echo -e '\e[7t\c' ; } # refresh xterm window
- MOVEWINDOW(){ echo -e "\e[3;${1:-0};${2:-0}t\c" ; } #move window to x,y pixels
- RESIZEWINDOW(){ echo -e "\e[4;${1:-620};${2:-900}t\c" ; } #resize height,width
- RESIZETERM(){ echo -e "\e[8;${2:-0};${1:-0}t\c" ; } #resize characters x,y
- RESTOREWINDOW(){ echo -e "\e[9;0t\c" ; }
- MAXWINDOW(){ echo -e "\e[9;1t\c" ; }
- FULLSCREEN(){ echo -e "\e[10;1t\c" ; }
- UNDOFULLSCREEN(){ echo -e "\e[10;0t\c" ; }
- #MAXWINDOW(){ MOVEWINDOW; RESIZE ; } #what was I thinkinghere?onDARWINthisis an x11util
- INSERTCHAR(){ echo -e "\e[${1}@\c" ; } # ICH insert Blank characters
- INSERTLINE(){ echo -e "\e[${1}L\c" ; } # insert $1 lines #IL
- DELETELINE(){ echo -e "\e[${1}M\c" ; } # delete $1 lines #DL
- DELETECHAR(){ echo -e "\e[${1}P\c" ; } # delete $1 characters #DCH
- SCROLLUP(){ echo -e "\e[${1}S\c" ; } # scroll up $1 lines #SU
- SCROLLDOWN(){ echo -e "\e[${1}T\c" ; } # scroll down $2 lines #SD ?useless?
- REPEAT(){ echo -e "\e[${1}b\c" ; } #REP repeat graphicchar ?useless?
- SCROLLZONE(){ echo -e "\e[${1};${2}r\c" ; } #DECSTBM set scrolling region
- LEDSET(){ # load LEDS #DECLL
- case "${1:-clear}$2" in
- clear|default) echo -e '\e[0q\c' ;; # clear all
- numlock|num) echo -e '\e[1q\c' ;; # light Num Lock
- capslock|caps) echo -e '\e[2q\c' ;;
- scrolllock|scroll) echo -e '\e[3q\c' ;;
- num*off) echo -e '\e[21q\c' ;; # extinguish Num Lock
- caps*off) echo -e '\e[22q\c' ;;
- scr*off) echo -e '\e[23q\c' ;;
- esac
- }
- #echo 663
- MODE(){
- for M in $@
- do
- case "${M}" in
- insert) echo -en '\e[4h' ;; # insert mode #IRM
- replace) echo -en '\e[4l' ;; # replace mode #IRM
- noecho) echo -en '\e[12h' ;; # no echo #SRM
- echo) echo -en '\e[12l' ;; # local cho #SRM
- cr) echo -en '\e[20l' ;; # cr only #LNM
- crlf) echo -en '\e[20h' ;; # send crlf #LNM
- 132) echo -en '\e[?3h' ;; # 132 column mode #DECCOLM
- 80) echo -en '\e[?3l' ;; # 80 column mode #DECCOLM
- allow) echo -en '\e[?40h' ;; # allow 80/132 switch
- allowoff) echo -en '\e[?40l' ;; # don't allow 80/132 switch
- jump|fast) echo -en '\e[?4l' ;; # Jump/fast scroll mode #DECSCLM
- smooth|slow) echo -en '\e[?4h' ;; # smooth/slow scroll mode #DECSCLM
- origin) echo -en '\e[?6h' ;; #DECOM lines are rel scroll zone
- originoff) echo -en '\e[?6l' ;; #DECOM back to normal
- wrap) echo -en '\e[?7h' ;; #DECAWM
- wrapoff) echo -en '\e[?7l' ;; #DECAWM
- repeat) echo -en '\e[?8h' ;; #DECARM auto repeat 0.5 seconds
- repeatoff) echo -en '\e[?8l' ;; #DECARM
- esac
- done
- }
- CURSOR(){
- case "$1" in
- save) echo -e '\e7\c' ;; # save cursor # DECSC
- restore) echo -e '\e8\c' ;; # restore cursor# DECRC
- show) echo -e '\e[25?h\c' ;; # show cursor # DECTCEM
- hide) echo -e '\e[25?l\c' ;; # hide cursor # DECTCEM
- report) #### Report Cursor Position CPR
- INVISIBLE;echo -e '\e[6n\c'; read -rn 16 -t 1.5;INVISIBLENOT
- CURSOR backward "${#REPLY}";CURSOR backward; # cleanup
- if [[ "${REPLY:1:1}" != "[" || 'R' != "${REPLY: -1:1}" ]] then
- xterm_info[6]=CURROW
- xterm_info[7]=CURCOL
- else
- REPLY="${REPLY#*\[}"
- REPLY="${REPLY%R}"
- xterm_info[6]="${REPLY%;*}"
- xterm_info[7]="${REPLY#*;}"
- fi ;;
- style) case "${2:-blink}${3:-block}" in # set cursor style DECSCUSR
- blinkblock) echo -en '\e[1 q' ;; # blinking block
- steadyblock) echo -en '\e[2 q' ;; # steady block
- blinkunderline) echo -en '\e[3 q' ;; # blinking underline
- steadyunderline) echo -en '\e[4 q' ;; # steady underline
- *) echo -en '\e[0 q' ;;
- esac ;;
- up) echo -en "\e[${2}A" ;; # CUU cursor up #$2 times
- down) echo -en "\e[${2}B" ;; # CUD cursor down #$2="" ==null==default==1
- forward) echo -en "\e[${2}C" ;; # CUF cursor forward
- backward) echo -en "\e[${2}D" ;; # CUB cursor backward
- nextline) echo -en "\e[${2}E" ;; # CNL cursor next line ?
- prevline) echo -en "\e[${2}F" ;; # CPL cursor preceding line ?
- column) echo -en "\e[${2}G" ;; # CHA move cursor to absolute column position
- backtab) echo -en "\e[${2}Z" ;; #CBT Backward to tabstop
- nexttab) echo -en "\e[${2}I" ;; #CHT Forward $2 tab stops
- ind) echo -e '\eD\c' ;; # Index
- rnd) echo -e '\eM\c' ;; # Reverse Index
- nel) echo -e '\eE\c' ;; # Next Line
- altcol) echo -en "\e[${2}\0140" ;; # Char position absolute HPA ???
- altline) echo -en "\e[${2}d" ;; # Line Position Absolute VPA ???
- altpos) echo -en "\e[${2};${3}f" ;; # Horizontal&Vertical Position HVP ???
- help) echo "#CURSOR rise then run" ;;
- *) echo -en "\e[${1};${2}H" ;; # CUP cursor position # default 1,1
- esac
- }
- #echo 731
- SELECTCAN(){ echo -e "\e[1\042q" ; } #DECSCA set char. protect attribute
- SELECTCANNOT(){ echo -e "\e[0\042q" ; } #DECSED DECSEL can erase
- ERASE(){
- #echo "${1:-line}_${2}"
- case "${1:-line}_${2}" in
- line_right) echo -e '\e[0K\c' ;; # EL erase in line # right
- line_left) echo -e '\e[1K\c' ;; # EL erase in line # left
- line_) echo -e '\e[2K\c' ;; # EL erase in line # all
- display_below) echo -e '\e[0J\c' ;; # ED Erase in Display # below
- display_above) echo -e '\e[1J\c' ;; # ED Erase in Display # above
- display_|screen_) echo -e '\e[2J\c' ;; # ED Erase in Display # all
- display_saved) echo -e '\e[3J\c' ;; # erase saved lines useless??
- selective_below) echo -e '\e[?0J\c' ;; # selective erase display
- selective_above) echo -e '\e[?1J\c' ;; # DECSED
- selective_screen) echo -e '\e[?2J\c' ;; # seems useless
- selective_lineleft) echo -e '\e[?0K\c' ;; # selective erase line
- selective_lineright) echo -e '\e[?1K\c' ;; # DECSEL
- selective_lineall) echo -e '\e[?2K\c' ;; # seems useless
- selective_rect) #DECSERA ERASE
- shift 2
- echo -e "\e[${1};${2};${3};${4}\${\c" ;; # top left bottom right
- rect_*) # useless in terminal.app
- shift # # DECERA Erase Rectangular Area
- echo -e "\e[${1};${2};${3};${4}\$z\c" ;; # top left bottom right
- char_*)
- echo -e "\e[${2}X\c" ;; # erase $2 characters backward ECH ?useless?
- screen_) #add another way to clear screen, maybe w/o home?
- CURSOR save;
- echo -e "\e[H\e[J\c" # H or J etc by themselves doesn't do it.
- CURSOR retore;
- ;;
- esac
- }
- #echo 767
- Paint(){ # what I always wanted from ERASE
- # paint a rectangle on the screen , taking the current postion
- # as one corner. then dx dy optionalcolor optionalcharacter flags
- # procedure will determine length, and height, and whether...
- # And, how to interpret dx dy, to create an appropriate corner.
- XTERMINFO clear #insert self gratifying remark here.
- # now get cursor position
- local integer cornerx
- local integer cornery
- CURSOR report
- cornerx=${xterm_info[6]}
- cornery=${xterm_info[7]}
- #now, paint this square right now with an X
- # since it will be needed to painted, regardlessly
- #PaintASqaure
- CURSOR save
- echo -e "A\c" #pedantically, we do CURSOR backward # but we don't need to
- CURSOR restore
- # now see if that works.
- # ok. opposing corner , then paint that
- local integer ox
- local integer oy
- # we should see if it works. but 1st presume it works
- let ox=cornerx+$1
- let oy=cornery+$2
- CURSOR $ox $oy
- echo -e "B\c"
- CURSOR backward
- # fixme: use the shorter corner
- # finish me!
- # no 2 short corner, I think, anyway .. yeah I want both varients
- # so...... on pause.........
- # I know solved this before.
- }
- meh() {
- for X in $@ ;
- do
- vtcls;
- BLINK; echo "delay="; BLINKNOT
- read delay
- vtlcs
- BLINK; echo "bs="; BLINKNOT
- read bs
- OSXTERMINAL && icontitle="$delay" && windowtitle="$bs"
- : # seems necessary # mb I should try with a -O0 compiled shell
- LF
- LF
- gdd delay="$delay" bs="$bs" if=$X 2> /dev/null|| break
- ICONIFIED && undock
- done # 80,2 seems a good fast setting
- }
- # I can imagine the mountains of noobs here,
- # but I feel Digital Equipment Solved blink.
- # noobs = no you can't do that with hearsay as reasoning
- # I can even picture 4 of them.
- # and they'd noob Input? too. There's no end with Noobs.
- # and delay? # depends on the noob, back and forth on the newline or not
- # is typical noob manufacturing device.
- # then they meet new noobs and I have no friends
- # then there's corrupt noobs == I can say you cheated
- wow(){ # and now fg, and then redraw with CTRL-L # thks #metoo generation
- for X in /usr/bin/* ;
- do
- print ''
- DOUBLEWIDTHLINE
- done
- }
- ICONIFIED(){ # true if iconified
- INVISIBLE;echo -e '\e[11t\c'; read -rn 4 -t 1.5;INVISIBLENOT
- CURSOR backward "${#REPLY}";CURSOR backward; # cleanup
- #echo "${REPLY:2:1}"
- #echo "${#REPLY}"
- (( "${REPLY:2:1}" == "2" ))
- }
- OSXTERMINAL(){ # true if running inside Terminal.app
- INVISIBLE;echo -e '\e[7n\c'; read -rn 20 -t 1.5;INVISIBLENOT
- if [[ "" == "$REPLY" ]] then
- (( 1 == 0 ))
- fi
- CURSOR backward "${#REPLY}";CURSOR backward; # cleanup
- [[ "$REPLY" == "Mac OS X Terminal" ]]
- }
- typeset -ai xterm_info # an array of integers
- XTERMINFO()
- {
- case "${1}" in
- clear|init)
- xterm_info[0]=XPOS
- xterm_info[1]=YPOS
- xterm_info[2]=XSIZE
- xterm_info[3]=YSIZE
- xterm_info[4]=TERMID
- xterm_info[5]=DEVATTR
- xterm_info[6]=CURROW
- xterm_info[7]=CURCOL
- xterm_info[8]=ROWS
- xterm_info[9]=COLS
- ;;
- dump|print)
- print "XPOS ${xterm_info[0]}"
- print "YPOS ${xterm_info[1]}"
- print "XSIZE ${xterm_info[2]}"
- print "YSIZE ${xterm_info[3]}"
- print "TERMID ${xterm_info[4]}"
- print "DEVATTR ${xterm_info[5]}"
- print "CURROW ${xterm_info[6]}"
- print "CURCOL ${xterm_info[7]}"
- print "ROWS ${xterm_info[8]}"
- print "COLS ${xterm_info[9]}"
- ;;
- [xX]) print ${xterm_info[0]} ;;
- [yY]) print ${xterm_info[1]} ;;
- [xX]size) print ${xterm_info[2]} ;;
- [yY]size) print ${xterm_info[3]} ;;
- *) print ${xterm_info[@]} ;;
- esac
- }
- WINDOWPOS(){ # get xterm window position ( in pixels )
- INVISIBLE;echo -e '\e[13t\c'; read -rn 16 -t 1.5;INVISIBLENOT
- CURSOR backward "${#REPLY}";CURSOR backward; # cleanup
- #echo "${#REPLY}"
- #echo "${REPLY:1:3}" |vis
- #[[ "${REPLY:1:3}" == "[3;" && 't' == "${REPLY: -1:1}" ]] && echo fine
- if [[ "${REPLY:1:3}" != "[3;" || 't' != "${REPLY: -1:1}" ]]
- then
- echo -e "\nnot fine"
- return # return false produced error when X="$(WINDOWPOS)"
- fi
- #echo "${REPLY:4:(( ${#REPLY} - 5 ))}"
- REPLY="${REPLY:4:(( ${#REPLY} - 5 ))}" # after this REPLY is 81;48 etc
- xterm_info[0]="${REPLY%;*}"
- xterm_info[1]="${REPLY#*;}"
- }
- WINDOWSIZE(){ # get xterm window size (in pixels)
- INVISIBLE;echo -e '\e[14t\c'; read -rn 16 -t 1.5;INVISIBLENOT
- CURSOR backward "${#REPLY}";CURSOR backward; # cleanup
- if [[ "${REPLY:1:3}" != "[4;" || 't' != "${REPLY: -1:1}" ]]
- then
- return
- fi
- REPLY="${REPLY:4:(( ${#REPLY} - 5 ))}"
- xterm_info[2]="${REPLY%;*}"
- xterm_info[3]="${REPLY#*;}"
- }
- TERMSIZE(){ # get xterm size of text area window size (in characters)
- INVISIBLE;echo -e '\e[18t\c'; read -rn 16 -t 1.5;INVISIBLENOT
- CURSOR backward "${#REPLY}";CURSOR backward; # cleanup
- if [[ "${REPLY:1:3}" != "[8;" || 't' != "${REPLY: -1:1}" ]]
- then
- return
- fi
- REPLY="${REPLY:4:(( ${#REPLY} - 5 ))}"
- xterm_info[8]="${REPLY%;*}"
- xterm_info[9]="${REPLY#*;}"
- }
- XTERMINALID(){
- INVISIBLE;echo -e '\eZ\c'; read -rn 16 -t 1.5;INVISIBLENOT
- CURSOR backward "${#REPLY}";CURSOR backward; # cleanup
- if [[ "${REPLY:3:4}" == "1;2c" ]] then
- xterm_info[4]=1 # string for terminal.app at least
- else
- xterm_info[4]=TERMID
- fi
- }
- DECDEVATTR(){
- INVISIBLE;echo -e '\e[0c\c'; read -rn 16 -t 1.5;INVISIBLENOT
- CURSOR backward "${#REPLY}";CURSOR backward; # cleanup
- #SEND DEVICE Attributes (PRIMARY DA) ... depends on decTerminalID resource
- REPLY="${REPLY#*\[}"
- if [ "${REPLY}" == "" ] ; then
- xterm_info[5]=DEVATTR
- elif [ "${REPLY}" == "?1;2c" ] ; then
- xterm_info[5]=1 # VT100 with ADVANCED Video Option
- elif [ "${REPLY}" == "?1;0c" ] ; then
- xterm_info[5]=2 # VT101 with NO Options
- elif [ "${REPLY}" == "?6c" ] ; then
- XTERM_INFO[5]=3 # vt102
- ELIF [ "${reply:0:4}" == "?60;" ] ; THEN
- xterm_info[5]=4 # VT220
- REPLY="{$REPLY:4}" # remaining parameters in REPLY
- else
- xterm_info[5]=DEVATTR
- fi
- }
- ENQUIRE(){
- INVISIBLE;echo -e '\05'; read -rn 16 -t 1.5;INVISIBLENOT
- CURSOR backward "${#REPLY}";CURSOR backward; # cleanup
- #REPLY is now answerbackString..if there is one.
- }
- DECREQTERM(){ # request terminal parameters #DECREQTPARM
- INVISIBLE;echo -en '\e[1x'; read -rn 30 -t 0.8 ;INVISIBLENOT
- CURSOR backward "${#REPLY}";CURSOR backward; # cleanup
- if [[ "$reply" == "" ]] then
- return
- elif [[ "${REPLY:1:3}" != "[3;" || 't' != "${REPLY: -1:1}x" ]] then
- REPLY="${REPLY%x}"
- REPLY="${REPLY#*3;}" #REPLY is now paramaters
- echo "$REPLY" |vis
- fi
- }
- #40 make 40 rows
- #4080 make 40 rows 80 columns
- #80 make 80 columns
- #### END XTERM related ########
- if [ -t 0 ]; ## only execute when stdin is a terminal
- then
- stty -ixon
- #set -o notify
- set -o emacs
- set -o markdirs
- #set -o noclobber
- #CDPATH="~/-"
- #bind "^I"=complete 2> /dev/null
- # directory aliases
- alias -d t=~/tmp
- alias -d vt=/Volumes/tmp
- alias -d tt=~/tmp/$(fn)
- if [[ ! -d ~tt/. ]]
- then
- mkdir ~tt
- fi
- alias -d 2up=~/tmp/2upload
- alias -d d=~/Desktop
- alias -d p=~/src/proj
- alias -d pg=~/src/proj/games
- alias -d ph=~/src/proj/hfs
- alias -d pp=~/src/proj/pbnew
- alias -d pm=~/src/proj/mbps
- alias -d xx=~/src/proj/xxio
- alias -d zelda="/Users/daniel/Documents/Games/zelda"
- alias -d Terminal='/Users/daniel/Library/Application Support/Terminal'
- alias tmp+='addto ~tt/tmp.txt'
- prompt $TERM
- #line specific
- tty=$(tty)
- case $tty in
- # #/dev/ttyE3) /var/root/bin/memcheck ;;
- # #/dev/ttyp*) XTERMINFO init ; XTERMINFO dump ;;
- /dev/ttyp*) XTERMINFO init ;; #XTERMINFO dump ;;
- esac;
- HISTFILE=~t/.mksh_history.${tty##/*/}
- alias typescriptv='script -a /Volumes/tmp/typescript.${tty##/*/}'
- fi
Add Comment
Please, Sign In to add comment