Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.32 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2. # create hash links on all files in the specified directory
  3. #
  4.  
  5. if [ ! -d $1 ] || ! cd $1 ; then
  6.     echo "'$1' must be a directory." >&2
  7.     exit 1
  8. fi
  9.  
  10.  
  11. for i in *
  12. do
  13.         if [ ! -h $i -a -r $i ] ; then
  14.                 hash=`openssl x509 -hash -noout -in $i` && ln -sf $i $hash.0
  15.         fi
  16. done