Topic: https://brettterpstra.com/oft-bash-function-for-opening-a-specific-filetype/
hide preview

What's next? verify your email address for reply notifications!

Lri 13y, 256d ago

How could this be generalized so that you could use any path selectors, or something like ls and open? Or is there already some smarter way to do that?

One alternative would be open *.xc*, but it obviously doesn't display a menu if there's multiple matches.

remark link
hide preview

What's next? verify your email address for reply notifications!

Lri 13y, 252d ago

This is probably completely wrong, but lso: ls and open — Gist.

hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 256d ago

Essentially, this is just a friendly wrapper around open *.xc*. You could modify the ls line to use any pattern if you wanted to do something different.

I would like to add an option parser to handle -a appname arguments so you could still specify which app to open the result in. I got frustrated with getopts before I got that worked out...

hide preview

What's next? verify your email address for reply notifications!