Quote:
please tell us how do you call dir from your shell.
Are you sure you are calling your function dir or instead are you calling the program dir?
|
That echo "my dir" was put here to show that my function is not being called. What is being called is:
Code:
$ whereis dir
dir: /bin/dir /usr/share/man/man1/dir.1.gz
-------------------------------
Quote:
What makes you certain it's sourced?
To be 100 percent sure, echo something before and after the function definition.
Also, when you type set, do you see your function?
|
Before making this thread I opened a new session (calling bash, opening another terminal window, anything that will surely source my bashrc without side effects from any existing environment). But to answer you,
set|grep -e '^dir ()' -A 9 outputs:
Code:
$ set | grep -e '^dir ()' -A 9
5390:dir ()
5391-{
5392- [
5393- # my function! :D
5394- ]
5399-}
-------------------------------
Quote:
Code:
$ which dir
$ alias
Are both good things to check as well here.
|
Code:
$ which dir
/bin/dir
$ alias | grep dir
dir='...'
I had an alias for dir... :P
Code:
$ # after fixing it...
$ type dir
dir is a function
dir ()
{
[
# my function! :D
]
}
'type' is a nice and new thing for me.
Thank you all!