#!/bin/csh # anyone want to rewrite this for /bin/sh?? # the for loop syntax is this: # for i in *;do (echo $i) ; done #---------------------------------------------------------- # This is the script that builds the bin/ directory. # It is called from wsh/Makefile #---------------------------------------------------------- set files="" #---------------------------------------------------------- # choose which sets of files you want in bin/ by # uncommenting the following lines. (or add your own) #---------------------------------------------------------- set files="$files ls mv cp rm mkdir rmdir echo" set files="$files cat tail cmp diff" set files="$files zcat zcmp zdiff" set files="$files compress compressdir uncompress uncompressdir" set files="$files clear pty resize stty tset tty" #set files="$files man col neqn nroff tbl" set files="$files grep banner date" #---------------------------------------------------------- # leave everything below here alone #---------------------------------------------------------- mkdir bin foreach f ($files) set found="nope" foreach i ( $path ) if ( -x $i/$f && ! -d $i/$f ) then set found=$i/$f break; endif end if ( "$found" == "nope" ) then echo "" echo "\!Couldn't find executable $f in your path." echo "" set lost else echo "Linking bin/$f to $found" ln -s $found bin/$f endif end set tmp=`echo $files | grep echo` # find out if.. if ( "$tmp" == "$files" ) then # they want 'echo' if ( -x /bin/echo ) then # `which echo` returns: shell built-in command. echo "Linking bin/echo to /bin/echo" ln -s /bin/echo bin/echo else echo "" echo "\!Couldn't find /bin/echo." echo "\!Either make a script to invoke echo or find the executable" echo "" endif endif if ( $?lost ) then echo "" echo "\!Some links could not be created" echo "\!Either your path is incomplete, or the executable is not on your system" echo "" endif # other stuff.. ln -s less bin/more # don't use real less or more - see security echo "Linking bin/more to bin/less (actual more is unsecure)" ln -s splitvt bin/splitmud # splitmud version of splitvt echo "Linking bin/more to bin/less (actual more is unsecure)" ln -s elvis bin/vi # same thing as less ln -s elvis bin/view # read only vi echo "Linking bin/vi to bin/elvis (actual vi is unsecure)" ln -s fget bin/fput ln -s fget bin/fls ln -s fget bin/frm echo "Linking ftp commands to fget" ln -s ../wsh bin/wsh # this is safe echo "Linking wsh (for shell escapes, etc..)" echo "Look at the *.tar files in the directory binsrc/" echo "You will want to make the executables and install them in bin/" echo "Also, make sure you install the executables in src/util"