Search code examples
macosctags

ctags error with mac


I have exuberant tags in my mac. Since, yesterday i am getting this error ctags: illegal option -- R usage: ctags [-BFadtuwvx] [-f tagsfile] file ...

I have followed the steps mentoned in this After following the steps mentioned here i can run ctags -R from command line(iterm) But when i execute the same command from a .sh (i have a shell script where i run the cscope and ctags command using it) file i get the above error again but not when i run ctags -R from iterm directly.

Any pointers on solving this issue will be really helpfull. Thanks in advance


Solution

  • So, the above issue seems to be fixed. The issue being that inside the ~/.bash_profile PATH variable should be set correctly. Even though my PATH variable was pointing to /usr/local/bin but /usr/bin appeared ahead of /usr/local/bin , hence somehow the ctags (when run from shell script) was picking up /usr/bin and not /usr/local/bin (which i have set alias to). Just move /usr/local/bin ahead of /usr/bin and it worked fine.

    Solution Type this in terminal: export PATH="/usr/local/bin:/usr/bin:$PATH"