linux - Why might cd call the function ':'? -


i using ubuntu (amazon ec2), , when type cd, happens:

$ cd hi hi hi hi hi hi hi hi hi $ 

i had made : function: : () { echo hi; }

this happens in top-level shell $shlvl=1, not in subshell (typing bash trying reproduce not work).

does know why may happening?

what did poor idea because : shell null command.

it useful time time in constructs require command. instance, if want code infinite loop using while, helps:

while true ;   : done 

take out : , it's not well-formed more: do requires command. out of following 3 one-liners, last 1 correct—try them:

while true done while true ; done while true : ; done 

if redefine : function, question is: defined? never mind that, suppose works. suddenly, these occurrences of : crop in scripts time time calling function!

what cd in amazon ec2 shell environment? maybe it's function. type set , browse through output. i've defined custom cd function; it's useful do. can things dynamically update prompt , window title , whatnot.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -