3 ms·
Here's an easy one: take all the files in a directory, including files nested in subdirectories, pick ten random ones, and open 'em in a new Firefox window.
by creata 6y ago
Here's an easy one: take all the files in a directory, including files nested in subdirectories, pick ten random ones, and open 'em in a new Firefox window.
firefox (find . -type f | shuf -n10)
I doubt your computer comes with a GUI program that can do that for you. My point is that CLIs can easily be plugged into each other whichever way you want, but GUIs (except in some niches like audio) aren't built that way for some reason.
- unnouinceput 6y agoI think you miss the point of API's regardless of your programming language. If it's used inside a CLI then definitely I can write a GUI program that does the same.
- creata 6y agoYou could write such a program, but my point is that it's a horrible inconvenience. CLI programs compose to the moon, but it's hard to get GUI programs to compose at all.
- fiddlerwoaroof 6y agoAlternatively, writing a program just is what you do at the shell with the find command, without building a GUI AND all the ceremony around getting a typical programming language needs to orchestrate processes.