3 ms·
Ask HN: 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 6y agoAdd this line to your ~/.bashrc shopt -s autocd (~/.bashrc is for options and settings, ~/.bash_profile is for environment variables.)
- dusted 6y agoMind == blown, it never even crossed my mind to search for this as an option, I just assumed.. Thank you!
- pforret 6y agoBash 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]