I have a function that I run often from the CLI, so I gave it the short name t
:
$ which t
/home/dotancohen/.bin/t
$ cat `which t`
#!/bin/bash
ctags-exuberant -f php.tags --languages=PHP -R
$ ls -lh /home/dotancohen/.bin/t
-rwxr-xr-x 1 dotancohen dotancohen 316 Jan 3 16:58 /home/dotancohen/.bin/t
$ echo $PATH
/home/dotancohen/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/dotancohen/.rvm/bin
However, when I try to run the program, I get a message that I should install another app that also uses the name t
:
$ t
The program 'task' is currently not installed. To run 'task' please ask your administrator to install the package 'taskwarrior'
How can I have Bash run /home/dotancohen/.bin/t
when I enter t
?
This is due to the fact that you have
t
defined as an alias (or a function), you can find it using thetype
builtin:Aliases, functions (and other shell builtins) take precedence over external executables.
To run the executable
t
from yourPATH
, do:Or
Or
Note that, just
t
is not a good name for a file.