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

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.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: