mkdir_ln 251 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #!/bin/sh # # If $2 is directory, mkdir in $1. If $2 is a file, make a symbolic back in $1 # back to $2 itself # # echo file name for debugging purpose echo "$2" if test -d "$2" then mkdir -p $1/"$2" else cd $ROOT/`dirname "$2"` ln -s "$2" . fi