# # helpful rc(1) functions and definitions # source in your $home/lib/profile # e.g., if(test -f $home/lib/env){ . $home/lib/env } # font=/lib/font/bit/vga/unicode.font GO111MODULE=on GOPATH=$home/lib/go GOROOT=/sys/lib/go/amd64-xx.xx.xx bind -qb $GOROOT/bin /bin bind -qa $GOPATH/bin /bin bind -qa $home/bin/acme /acme/bin # # custom prompts # prompt=('% ' ' ') # *nix-style, static (e.g., user@host%) #prompt=($user'@'$sysname'% ' ' ') #fn `{echo $prompt(1) | tr -d ' '} { $* } # *nix-style, simple dynamic (e.g., /dir%) # ¡ACHTUNG! prompt is not a no-op; breaks whole-line send #prompt=(`{pwd | sed 's!'$home'!~!'}^'% ' ' ') #fn cd{ # builtin cd $1 # prompt=(`{pwd | sed 's!'$home'!~!'}^'% ' ' ') #} # *nix-style, fancy dynamic (e.g., [user@host:/dir]%) # ¡ACHTUNG! prompt is not a no-op; breaks whole-line send #prompt=('['$user'@'$sysname':'^`{pwd | sed 's!'$home'!~!'}^']% ' ' ') #fn cd{ # builtin cd $1 # prompt=('['$user'@'$sysname':'^`{pwd | sed 's!'$home'!~!'}^']% ' ' ') #} # # nice "aliases" # fn ..{ count=`{echo $1 - 1 | bc} goto=../ >[2=] while(test $count -gt 0){ count=`{echo $count - 1 | bc} goto=$goto../ } cd $goto } fn ...{ .. 2 } fn :p{ cat $home/lib/rc.hist } fn :q{ exit } fn :w{ savehist } fn :wq{ savehist; exit } fn amail{ acme -l $home/lib/dump/mail.acme } fn anew{ acme -l $home/lib/dump/base.acme } fn c cl cls{ clear } fn cd..{ .. } fn chmor{ chmod +r $* } fn chmot{ chmod +t $* } fn chmow{ chmod +w $* } fn chmox{ chmod +x $* } fn chmost{ chmod 755 $* } fn chmall{ chmod 777 $* } fn chown{ chgrp -u $* } fn ll{ ls -l $* } fn mkd{ mkdir -p $* } fn sid{ /bin/sid -sky /lib/sky/here $* } fn su{ rcpu -u $* } fn vtssh{ vt -brx -f /lib/font/bit/spleen/spleen.16.font ssh $* } # # stock no-op functions # fn %{ $* } fn cpu%{ $* } fn term%{ $* } # # working w/ physical media # fn mem{ mount -c <{dossrv -s >[0=1]} /n/dos $1 } fn iso{ mount <{9660srv -s >[0=1]} /n/iso $1 } fn eject{ echo eject > /mnt/cd/ctl } fn cdfs{ /bin/cdfs -d /dev/sdE1 } fn cddb{ cdfs grep aux/cddb /mnt/cd/ctl | rc } fn rip{ cdfs for(t in /mnt/cd/a*) audio/oggenc < $t > `{basename $t}^.ogg }