Reputation: 10558
I have a script in bash
which uses the HTK toolkit
. One of the files that the HTK tool uses is called do
and is present within a directory called hmm_1/
. Now, when I need to call a particular tool from within the HTK toolkit, I do it like so:
some HTK command -H hmm_1/do -H hmm_1/<something else>
and so on. I just noticed that gvim
highlights the do
file name in the above command, thinking it is a keyword. However, it is a file name. My question is:
Note: I cannot change the name of the file now. I will have to backtrack through a large number of steps.
I just don't know how to phrase this question. Help in editing the question line is most welcome.
Upvotes: 1
Views: 1468
Reputation: 74750
Other than using the command as part of an explicit path (like Ernest proposed, and what will do in your case), you can also use the command
builtin to search commands which are in some directory in the $PATH
variable, ignoring aliases, shell functions and shell keywords:
$ echo '#!/bin/bash
> echo Hello World!' > ~/bin/do
$ chmod u+x ~/bin/do
~/bin
is in my path, thus this would normally work:
$ do
bash: Syntaxfehler beim unerwarteten Wort `do'
It does not, since it is a reserved word. Prefixing it with command
helps:
$ command do
Hello World!
As does using the full path:
$ ~/bin/do
Hello World!
Upvotes: 1
Reputation: 81684
As part of a path, keywords will be ignored. They will only be interpreted as a keyword at the beginning of a command. It would be best to simply consider gvim
's highlighting to be a minor annoyance and ignore it.
Upvotes: 3