Can this one liner determine if program halts too?
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. :)
That's impossible, look up the Halting problem
That's the joke
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.
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 🫰
Linux
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.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0