From 309d50df87a455337ec3c9bd6d0f43ede348e0c6 Mon Sep 17 00:00:00 2001 From: Seth Underwood Date: Thu, 30 Jun 2016 17:03:57 -0400 Subject: [PATCH] Better fix for symlinks Better fix for symlinks This is a better fix for finding symlinks. This uses the `find` option "-L" to follow the symlink, but return the path using the symlink. Although, it may be better to use the "-H" option to return the path to the linked file as it will keep `list_path` from returning the two identical files if the symlink points to a file in the same search path. --- bin/list_paths | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/list_paths b/bin/list_paths index 01ef0d3..354e48a 100755 --- a/bin/list_paths +++ b/bin/list_paths @@ -55,7 +55,7 @@ set outdoc = "$out.html" touch $out # create the file if it doesn't exist cp $out $src -find $* \( -type f -o -type l \) -a \ +find -L $* -type f \ \( -name \*.c \ -o -name \*.C \ -o -name \*.f \ @@ -72,7 +72,7 @@ sed 's:.*/\(.*\):\0 \1:' $src | nl | sort --key 3 -u | sort -n | awk '{print $2} echo "A list of the files you checked out is in the file $out ..." touch $doc # create the file if it doesn't exist -find $* \( -type f -o -type l \) -a \ +find -L $* -type f \ \( -name \*.html \ -o -name \*.ps \ -o -name \*.txt \