Skip to content

Instantly share code, notes, and snippets.

@ivand58
Created June 9, 2019 18:23
Show Gist options
  • Save ivand58/58a95b55715d677c1cf89cd4f05b9b24 to your computer and use it in GitHub Desktop.
Save ivand58/58a95b55715d677c1cf89cd4f05b9b24 to your computer and use it in GitHub Desktop.
generates input for cscope with special treatment of the links
# Write only the files which are NOT symlinks
find `pwd` \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.cc" -o -iname "*.h" \) -and \( -not -type l \) \) -print > cscope.files
# Add the target of the symlink for all files matching the right extension, and are symlinks
find `pwd` \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.cc" -o -iname "*.h" \) -and -type l \) -exec readlink -f {} \; >> cscope.files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment