As I've been working on an install script for making my setup more portable, this is handy and timely. Thanks for sharing!
PS I hate to be the UUOC person. I'm sure you're already aware and it was a deliberate choice.
As I've been working on an install script for making my setup more portable, this is handy and timely. Thanks for sharing!
PS I hate to be the UUOC person. I'm sure you're already aware and it was a deliberate choice.
PS I hate to be the UUOC person. I’m sure you’re already aware and it was a deliberate choice.
I wish it was. I honestly forgot. yeah, shame on me. :D Before this, at the position of cat there was actually a different command, which I replaced with this. And I didn't think of adding the file to awk instead. I'll update the line with this suggestion and a suggestion from someone else.
Can this one liner determine if program halts too?
That's impossible, look up the Halting problem
That's the joke
I'm actually not sure what you mean by that. This script will only list the programs you used in the terminal. It prints the fullpath of each command. That's all it does.
Do you want know if a program is currently running?
Silly me misunderstood the intention of the script. I imagined it lists the programmatic paths the program can take, like all the decision in the program. :)
sort | uniq can be sort -u instead btw
They are not exactly the same. I always default to piping it, because I never remember which to use when. And had to lookup again to make sure I was not hallucinating: https://unix.stackexchange.com/questions/76049/what-is-the-difference-between-sort-u-and-sort-uniq/76095#76095
Interesting, I never knew. Thanks
I agree they aren't the same, especially if you need uniq to count things.
However, be aware that pipes can be a real problem in scripts because of globbing and expansion.
Or just use zsh 🫰
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0