Hacker News new | past | comments | ask | show | jobs | submit login

That's your shell rather than the OS.

I've been writing my own Linux $SHELL and one of the features is that asterisks don't get expanded by the shell to avoid accidental bugs from the situations you described.




How would you invoke something like `rm * .bak` in such a shell? Do you have a separate command for globbing, such as:

  rm $(glob *.bak)


Yeah pretty much just that:

    rm @{g *.bak}
`g` returns a JSON array of file names and the @{} tells the shell to expand the array into parameters.

This way you don't need to worry about spaces in file names or other problems with escaping.


What if I wanted to delete the two files "@{g" and "*.bak}"?


You'd just put them in quotes as you already had done. In that regard the shell is designed to behave very similarly to Bash.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: