For bash, sh, ksh: #!/bin/bash # Absolute path to this script, e.g. /home/user/bin/foo.sh SCRIPT=$(readlink -f $0) # Absolute path this script is in, thus /home/user/bin SCRIPTPATH=$(dirname $SCRIPT) echo $SCRIPTPATH For tcsh, csh: #!/bin/tcsh # Absolute path to this script, e.g. /home/user/bin/foo.csh set SCRIPT=`readlink -f $0` # Absolute path this script is in, thus /home/user/bin set Full Article…
Viewing 1 to 2 of 2 items
exclude directories in recursive grep without -exclude-dir
I’m trying to do a recursive grep on a directory while excluding all the .svn folders. How can I do this? This works: grep -iR “string” * | grep -v “.svn”