##############
#Unix Command
##############
ALIAS USERS exec users
ALIAS WHATIS exec whatis
ALIAS WHEREIS exec whereis
ALIAS DATE exec date
ALIAS TAR exec tar -cf $0.tar $0
ALIAS UNTAR exec tar -xf
ALIAS SPING exec ping $0 | tail -2
ALIAS WORDS exec wc
ALIAS UPTIME exec uptime
ALIAS RUP exec rup
ALIAS RUSERS exec rusers
ALIAS QUOTA exec quota -v
ALIAS SPACE exec du -s $HOME
ALIAS PS exec ps -x
ALIAS PS2 exec ps -u `whoami`
ALIAS KP exec kill -9 
ALIAS CAL exec cal
ALIAS LS exec ls -FC
ALIAS LSA exec ls -aFCs
ALIAS DIR exec ls -l
ALIAS NSLOOKUP exec nslookup
ALIAS FROM exec from
ALIAS FRM exec frm
ALIAS MV exec mv
ALIAS CP exec cp -r
ALIAS MKDIR exec mkdir
ALIAS GREP exec grep
ALIAS CHMOD exec chmod
ALIAS ZCAT exec zcat $0
ALIAS FIND exec find $HOME -name $0 -print
ALIAS FILE exec file
ALIAS SORT exec sort
ALIAS UNCOMPRESS exec uncompress
ALIAS COMPRESS exec compress
ALIAS GZIP exec gzip
ALIAS GUNZIP exec gunzip
ALIAS MAIL exec mail $0 < $1
ALIAS UUENCODE exec uuencode $0 $0 > $0.uue
ALIAS UUDECODE exec uudecode
ALIAS UNZIP exec zcat $0 | tar xf -

ALIAS CAT {
  if ([$0]) {
     @numberoflines = 0
     @startingline = 0
     @numlinesdisp = 0
     ^assign fileview $0
     ^assign startingline $1
     ^assign numlinesdisp $2
     ^on ^exec "nlines *" ^assign numberoflines $$1
     ^exec -name nlines wc -l $fileview
     ^wait %nlines
     ^on exec - "nlines *"
     if ([$numlinesdisp] == [0]) {^assign numlinesdisp $numberoflines}
     if ([$startingline] == [0] && [$numlinesdisp] == [0]) {cat $fileview} {
       @tln = numberoflines - startingline
       exec tail -$tln $fileview | head -$numlinesdisp
       }
     }{
       echo *** USAGE: /cat <filename> <starting line> <number of lines to display>
       }
  }

##########
#NSLOOKUP#
##########
# DEFINE THE NAME OF YOUR NSLOOKUP PROGRAM HERE
@nslprog = [nslookup]

alias nsl {
  ^assign -nslnick
  ^assign -nslnick2
  ^assign nslnick $0
  ^assign nslnick2 $0-
  userhost $nslnick -cmd do_nsl $$4
  }

alias do_nsl {
  if ([$0]==[<UNKNOWN>]) {nslookup $nslnick2} {nslookup $0}
  }

alias nslookup {
  ^assign nslooking $0-
  exec $nslprog $nslooking
}

