HACKER Q&A
📣 dusted

Hey bash, are you stupid?


Inspired by the nice things about Amiga, I came thought on this, are there any good reasons why we don't have bash enter directories when we type their name ?

De[TAB]

Desktop/[ENTER]

Bash: Desktop/: Is a directory

User:

Yes, I know, what do you think I want to do wit it ?

Run it? Are you stupid? It's not a program!

Move it? Are you stupid? That'd take another argument!

Rename it? Are you stupid? That'd also take another argument.

Delete it? Are you stupid? Why'd I want something so dangerous to be so easy, also, that requires the recursive argument.

Gee.. I dunno then.

User:

cd Desktop/

Bash: Ohh


  👤 gjvc Accepted Answer ✓
Add this line to your ~/.bashrc

   shopt -s autocd

(~/.bashrc is for options and settings, ~/.bash_profile is for environment variables.)

👤 pforret
Bash allows you to [TAB] into a folder because the program/script you want to execute might be there, just 1 or more [TAB]s further. It's not bash's fault that you try to do something that doesn't make any sense.

De[TAB]

Desktop/[TAB]

Desktop/run_this_script.sh[ENTER]