On 2013-12-06 03:28, Marcel Loose wrote:
On 05/12/13 18:27, Matthew Woehlke wrote:
On 2013-12-05 02:36, Alan W. Irwin wrote:
Sorry, this turned out to be a false alarm. Despite "which cmake"
telling me I was using cmake-2.8.12.1 [snip]
...which is, of course, why you should always use "type" in bash
rather than "which" :-). "type", being a shell built-in, will tell you
what bash will *actually* run, hashing - and shell builtins, and
functions, and aliases - included.
Hmm, interesting. I didn't know the "type" command. However, is there a
way to easily parse the output of "type"?
It depends what you're trying to do. Problems can arise because the
"command" might be an alias, built-in, function, etc. and the correct
thing to do is to report this (or if you're trying to parse the output
e.g. in a script, your script should be prepared to handle this).
That said, some combination of inspecting the -p, -P and/or -t options
will probably get you there. I'd strongly encourage you to read the
output of 'help type' :-). 'type' with no options is mainly intended for
humans to read.
--
Matthew
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers