@Fizzbuzz some people just like tiling wms, and it can kind of increase window switching speed, with each number meaning 1 to ~4 windows. Configuring is just fun.
I spent years studieing all the GNU options. Finally I approach mastery. Every morning I scream at the mirror "My scripts may never work on the beasts system and his name is the mac"
all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle What the fuck are you even doing all the way down here? Are you crazy? :P
TIPS: 1. Most Linux distributions come with both GNU and POSIX manpages. When writing POSIX compliant scripts I always check POSIX manpages for all the supported options. `man 1 cmd` - GNU manpage; `man 1p cmd` - POSIX manpage. 2. POSIX way of doing sed -i: $ create temporary file (mktemp is not in POSIX, POSIX ways of creating temp files is to use noclobber or mkdir -m 700 with randomly generated name) $ sed '...' file > temp_file $ mv temp_file file 3. I recommend creating that temporary file in the same folder - not in /tmp etc. Reason for this is that mkdir and mv (when both input and output paths are on the same filesystem) are the only atomic filesystem operations. If we create temp file in /tmp and then do `mv` it might do `rename` internally or it might become `cp + rm` combo - and cp is not atomic. Example: $ create temp_file $ sed '...' file > temp_file $ cp temp_file file This way might leave you with damaged file if you stop cp in the middle of copying. mv (if and only if both input and output paths are on the same filesystem) turns into `rename` which is atomic and this guarantees us ACID - our file will never get corrupted, it will either get updated completely or not at all.
@@firstnamelastname7248 Yes and no. Depends what you really want/need. 1. If you do not need to protect yourself against parallel execution then it is OK. 2. But if you do run script twice in parallel (and they will use same name for temp_file) then they both will create the file and fight against each other. 3. One of the solutions could be to use noclobber option like I mentioned `set -C`. This way redirection cmd > temp_file will fail if the file already exists, so one script will create a file and proceed corectly and the second script will fail. 4. The question is then how to handle that fail: you can use `set -e` and then your script will simply exit with failure, or you can put cmd > temp_file in a loop until it finally succedes preferrably changing the temp_file name randomly to avoid clashing with other parallel instance of the script.
@@dlarge6502 What happens if you try the *man p1* trick without those packages available on the system? Does it throw an error or does it just show the local (potenteially non-POSIX) manual?
I’d just like to interject for a moment. What you’re refering to as Linux, is in fact, GNU/LInux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux
No, Richard, it's 'Linux', not 'GNU/Linux'. The most important contributions that the FSF made to Linux were the creation of the GPL and the GCC compiler. Those are fine and inspired products. GCC is a monumental achievement and has earned you, RMS, and the Free Software Foundation countless kudos and much appreciation. Following are some reasons for you to mull over, including some already answered in your FAQ. One guy, Linus Torvalds, used GCC to make his operating system (yes, Linux is an OS -- more on this later). He named it 'Linux' with a little help from his friends. Why doesn't he call it GNU/Linux? Because he wrote it, with more help from his friends, not you. You named your stuff, I named my stuff -- including the software I wrote using GCC -- and Linus named his stuff. The proper name is Linux because Linus Torvalds says so. Linus has spoken. Accept his authority. To do otherwise is to become a nag. You don't want to be known as a nag, do you? (An operating system) != (a distribution). Linux is an operating system. By my definition, an operating system is that software which provides and limits access to hardware resources on a computer. That definition applies whereever you see Linux in use. However, Linux is usually distributed with a collection of utilities and applications to make it easily configurable as a desktop system, a server, a development box, or a graphics workstation, or whatever the user needs. In such a configuration, we have a Linux (based) distribution. Therein lies your strongest argument for the unwieldy title 'GNU/Linux' (when said bundled software is largely from the FSF). Go bug the distribution makers on that one. Take your beef to Red Hat, Mandrake, and Slackware. At least there you have an argument. Linux alone is an operating system that can be used in various applications without any GNU software whatsoever. Embedded applications come to mind as an obvious example. Next, even if we limit the GNU/Linux title to the GNU-based Linux distributions, we run into another obvious problem. XFree86 may well be more important to a particular Linux installation than the sum of all the GNU contributions. More properly, shouldn't the distribution be called XFree86/Linux? Or, at a minimum, XFree86/GNU/Linux? Of course, it would be rather arbitrary to draw the line there when many other fine contributions go unlisted. Yes, I know you've heard this one before. Get used to it. You'll keep hearing it until you can cleanly counter it. You seem to like the lines-of-code metric. There are many lines of GNU code in a typical Linux distribution. You seem to suggest that (more LOC) == (more important). However, I submit to you that raw LOC numbers do not directly correlate with importance. I would suggest that clock cycles spent on code is a better metric. For example, if my system spends 90% of its time executing XFree86 code, XFree86 is probably the single most important collection of code on my system. Even if I loaded ten times as many lines of useless bloatware on my system and I never excuted that bloatware, it certainly isn't more important code than XFree86. Obviously, this metric isn't perfect either, but LOC really, really sucks. Please refrain from using it ever again in supporting any argument. Last, I'd like to point out that we Linux and GNU users shouldn't be fighting among ourselves over naming other people's software. But what the heck, I'm in a bad mood now. I think I'm feeling sufficiently obnoxious to make the point that GCC is so very famous and, yes, so very useful only because Linux was developed. In a show of proper respect and gratitude, shouldn't you and everyone refer to GCC as 'the Linux compiler'? Or at least, 'Linux GCC'? Seriously, where would your masterpiece be without Linux? Languishing with the HURD? If there is a moral buried in this rant, maybe it is this: Be grateful for your abilities and your incredible success and your considerable fame. Continue to use that success and fame for good, not evil. Also, be especially grateful for Linux' huge contribution to that success. You, RMS, the Free Software Foundation, and GNU software have reached their current high profiles largely on the back of Linux. You have changed the world. Now, go forth and don't be a nag. Thanks for listening.
Luke: *sed -i* does work in BSD. At least in OpenBSD. From its manual: " *-i* [ _extension_ ] Edit files in place, saving backups with the specified extension. If a zero length extension is given, no backup will be saved. It is not recommended to give a zero length extension when in place editing files, as it risks corruption or partial content in situations where disk space is exhausted, etc. In *-i* mode, the hold space, line numbers, and ranges are reset between files." Maybe not exactly the same, but many times, the same in practice. Plan 9 and Plan 9's utilities aren't POSIX-compliant. If something in it happens to be, it is rather by coincidence than by conscious effort. The cat-v crowd doesn't generally like POSIX. And writing your scripts in, say, rc shell (Plan 9's) would make your scripts much less portable, as the users would have to install plan9port to use them. One last thing: have you tried acme(1) more extensively as of late? It may be a bit of an acquired taste, but I seriously think you can like it a lot.
@@LukeSmithxyz not having the flag does not mean automatically that is POSIX compliant. Also commands should not overlap, GNU versions should be gnu-sed, gnu-awk, etc. like gawk and so forth they present themselves as different.
You know, the SHITTY thing is, apparently alot of thees things are quite handy (otherwise you wouldnt use them) but instead of adding similar "GNUisms" to POSIX aaaaaanything, even the good stuff, thats developed on/for Linux is vehemently ignored by the rest of the "Unix world"... Oh boy would it be terrible if those Mac users had actually convenient shell commands, right? I say, embrace the good stuff (feel free to hate on things that are actually terrible ofc) and if others dont want to improve, hf debugging. I mean, last time ive checked all of this stuff was still open source.
A) I don't think you'd miss anything if you were on a Mac. + As mentioned in the video BSDs and Mac also add their own extensions that can be just as good as the GNU ones just with different syntax. 2) You can just run the GNU utils if you prefer them on macOS or whatever. 3) Source code being available doesn't mean easy adaptation. The GNU Core Utils are made pretty portably, but a great tool like diskutil on macOS unfortunately can't easily be ported to Linux even with full source code availability
Its worth pointing out that the GNU utils maybe bloated but, GNU's Not Unix ;) GNU was written to be "upwardly" compatible with UNIX. So it can do UNIX (POSIX) stuff and will be compatible with it. I think Stallman went this route so he could avoid having legal battles based on his OS being a UNIX (all the battles between those who claim to own UNIX are fun reading). Also when he started writing GNU he had never even used UNIX. Its great he chose to be compatible with it and to write GNU to target the 32 bit cpu's (the 386) that he was sure were going to be the most popular architecture.
The coreutils are like that and get features because of convenience. SOme tasks are unnecessarily complex to implement otherwise or would need needless reimplementation by each damn user because Coreutils doesn't come with a complete solution. This problem with different "vendor" versions of some tools behaving differently only pertains users that try to port scripts to other OSs or use different OSs with different vendor versions of those tools. I think the existing solution (expanding the Coreutils' functionality) does much more good than bad in comparison to not doing it and keeping them all the same on all OSs. Some tools also _need_ to behave differently because of different APIs (E.g. ifconfig on Linux, ifconfig on 'BSD).
the problem is they don't SAY what is their own convenience feature... people assume that because it's not said otherwise, stuff like cat -v would work on other posix-compliant systems... also unix philosophy is to do one thing only, which is why utilities like `nl` are separate, and `cat -n` shouldn't be a thing... etc, etc...
I absolutely agree with you. i think even Luke would rather use the -i arg rather than output changes in file.new and replace file.old by file.new . But i don't think that this video is really a rant about the huge list of argument or even that he is defending the cat -v team. I think he just used the word "bloat" because it's a meme at this point but really he wanted to say that not all unix are made equal and that just like with higher level langages, if you don't have the same version of the lib then your code is not portable. In this case bash and gnu core utils are not the same everywhere
I mean you cooouuuulld use ed instead of sed and get around the edit-in-place problem....but still... and yeah that's a problem, but there's a solution... busybox! ;P statically compiled busybox against musl or something like that, and boom, ya got most everything you'd need ;)
I will say, I am fond of many GNU coreutils innovations. The one kinda annoying thing is their tar, GNU tar is cool for personal archives, but often really annoying when you don't want some of the features. Sometimes you don't want your tarball to preserve your "immutable" or "append-only" extended attributes.
In my experience with other Unix utilities (find, grep, see, awk). GNU utilities are much faster. if I'm using a Unix OS like Solaris, I prefer using the GNU utilities.
@@corey8704 it’s GNU Image Manipulation Program, but the green is my pepper thing is from an email someone send to stallman, he didn’t know what gimp was and they used the green default pepper in GIMP to show that they where using free software, and stallman erroneously assumed that GIMP means Green Is My Pepper.
Random comment about this... when you had the man page open for sed I noticed that there is a --posix flag, so you could test with all GNU extensions disabled which could be helpful for making a posix compliant version on a GNU version of a utlity (assuming it is common across other utils) Awesome video as always :D
@@Joe3D Ideally you wouldn't put it in your scripts. You _could_ set the flag using an alias, but then that might break other things that rely on GNU extensions...
Hey Luke, have you ever thought about the fact that the birth of Unix and Unix-like operating systems as we know it today was essentially the result of an epic gamer moment? Ken Thompson was perhaps the original oppressed gamer. I'd like to see a video on your opinions on this subject.
posix is good if you have to be portable, for example in an opensource project which supports multiple platforms, but for anything else on linux, please use bash and the gnu utils. it makes your life way easier. don't go back to the 90's!
Since there's no binary compatibility between FreeBSD / OpenBSD / NetBSD / GNU Linux / MacOS there's no fuss with why GNU Linux commands offer more options than other :)
But the problem was just caused by enthuasm. I wrote some unix utilities as an excersice when I was learning C and while you are writing them, all these good ideas keep popping into your head, like when you do the option to append, you think, "why not add an option for the line-before-last" and so on. All those bloated options are written by programmers who were just bubbling over with good (and sometimes not-so-good) ideas! It's just something we have to live with. You can't stop people trying to improve things. It would be wrong.
A little nitpick - Plan 9 tools aren't minimally POSIX compliant; POSIX makes a number of compromises and accounts for common extensions that arose amongst GNU and multiple free and proprietary unices, so they could have vague source-level compatibility. Half the point of Plan 9, meanwhile, was to make a clean break in userland. They've got their APE subsystem, the “ANSI/POSIX Environment”, but that's another story.
posix may be the spec standard but Linux and its cadre of gnu tools is by now the predominate defacto standard for Unix flavored OS; i.e., more books are sold on instructing how to use gnu tools on Linux than books on, say, FreeBSD or the command line tools of the shell on Mac OSX
Not really. You'll have issues porting between different distros. If you write a non POSIX script for arch it will NOT work by default on Debian. Takes only a small modification to make it work on Debian bit then you have a performance hit
There is a way better example than this: glibc. Glibc is considered by far the worst C library existing, for a very good reason: it's bloated, and is intentionally bloated. It is also very backwards-incompatible and all that to prevent people from static linking. Another good example is GCC, LLVM is a thing today because GCC is intentionally bloated and has developer unfriendly characteristics. With GNU, as always, it's a matter of phylosophy, you either embrace it, like I do, or you will find something which is inconvenient. I find this very consistent with their battles and I honestly admire them for estabilishing standards left and right while pushing forward their ideals.
problem is that GCC is basically the best compiler around, for now, even if only because of its age...though LLVM's clang isn't too far behind (I've got no modern stats to prove any of my claims though) and did you mean all of LLVM, or only clang?
@@jan_harald clang is not Free Software hence companies like Apple improve it and don't give back code. That's why Apple switched from bash to zsh, they change and bundle it only in binary form.
I'm a total GNU nut, but I can totally agree. GNU utilities come with way too much fluff. I pronounce "Core Utils" with more emphasis on the I, like "you-TILL-s" as in "uTILity". Is this just a preference or is it really "Core-yoodles"?
Ohh cat-v.org from Uriel, thanks for still showing that page. It's not possible to understand suckless.org without him, he was very involved in wmii/dwm/and other tools and advices. Descansa en pau Uriel. R.I.P
I'm a bit late for this, but Plan9 is not about POSIX compliance. Like not at all. The system utilities are even written with Plan9's own "standard" library of C functions. The reason the Plan9 utilities are considered "non-harmful" is because they implement only the functionality they need to in order to do their job effectively. It sounds like you may have read this paper (harmful.cat-v.org/cat-v/unix_prog_design.pdf) before making this video, but if you haven't it explains the perspective the designers of Plan9 had when writing the system. Also, the Plan9 cat program does have two options, -m and -n, while the POSIX standard cat has one option, -u. You didn't notice them because Plan9 manpages aren't formatted like we are used to, with each option as a separate subsection.
@@LukeSmithxyz exactly, that's kinda annoying to have to make temp files like this, though... unless you somehow load all of the file into memory, and THEN pipe and replace the file... I know `mv text.txt.new text.txt` is basically instant, but I dislike such "useless" temp files on principle... imho temp files should be used in some way and not just moved to different name...(such as splitting it up, or editing further, or something...) `cat file >file.new ; mv file.new file` is bloat... (sed or whatever is same...)
@@LukeSmithxyz It does blank the file, but that is simply because opening a file for writing in UNIX blanks the file. But what I was trying to do is evil anyway since sed 's/short/veryverylong/' file > file would print garbage regardless. In any case, here's how you would do you it on Plan 9 (using rc syntax): echo '{sed `s/file/FILE/` file} >file Using the uglier Unix sh syntax this would be something like: echo "$(sed 's/file/FILE' file)" > file So what's better about this? Simple: if you write programs you have to write less code. If you use programs, you don't have to worry about sed implementing '-i' correctly.
But the info page totally mentions how -i in sed is not posix compliant and then says there is another option --posix which will limit the functionality of sed to posix compliant and the environmental variable, or how you can set POSIXLY_CORRECT (cause --posix would break the other sed(s) I guess)
Technically, GNU was a project to make an independent and FOSS version of Unix, and they had worked on the core utils for a while, but never got to actually making the kernel. But then Linux showed up, and they went with that. So the GNU core utils wasn't made for Linux, it was made for GNU, but then they went with Linux as the kernel and helped each other out.
mac has its own flags. Bsd as as well. I prefer to use the feature rich one. If you are aiming multi platform stuff, use a programming language like perl, python, ruby. Otherwise you have to live with that.
Why did you quote the command for sed (like: $ sed 's/file/FILE/' file)? I think there is no blob and other special character of shell in that command line.
@@LukeSmithxyz well... guess I was wrong. BTW just found out a way in which that approach can work. sed "s/FILE/file" | sponge file You'll need moreutils package thou.
by the time sed is executed file is empty because redirection happens before execution and truncates file. Instead run echo "$(sed s/file/FILE/ file)" > file
A few years ago, I went through the exercise of installing and having the Plan 9 coreutils in my path prior to the GNU coreutils and found that running almost anything that I hadn't explicitly written myself became a monumental pain in the backside. So I uninstalled the Plan 9 coreutils to remedy the issue; I might play with them again on a non-critical system at some point. I think I was pretty late to the game on discovering the GNU sed easy mode -i option. I used "sed 's/pattern/replacement/' file > /tmp/file && mv /tmp/file file" all the time before my enlightenment. (And yes, there was much data loss since all of my files were named file. It was the dark ages, what can I say?)
I know this is old, but... 1) With BSD sed, if you don't want to store a backup when doing inplace, you can run it as [sed -i ''] 2) For inplace sed, gnu's --follow-symlinks option is nice. Normally, sed -i clobbers a symlink with a regular file and leaves the linked-to original file alone. Obviously, follow-symlinks tells it to work on the linked-to file.
I don't think that scripts should ALL be posix compliant. POSIX is rather old, limiting and akward at times, so i mostly try to stay posix compliant since it isn't hard for most tasks, but when some certain addition can save me a few dozen minutes or even hours? Yep, i am taking it and never looking back.
I bet after the videos he just opens up his Ubuntu gnome setup
Windows Vista
@@rothbardfreedom Windows ME
Windows Bob *
@William Day Wut lol
@Fizzbuzz some people just like tiling wms, and it can kind of increase window switching speed, with each number meaning 1 to ~4 windows. Configuring is just fun.
If your scripts don't run on Alpine Linux and OpenBSD don't talk to me or my son ever again
*my wife's son
*my son's wife
Danganronpa can only be bought with DRM, bloat
Make scripts POSIX compliant! Reeeeee!
I spent years studieing all the GNU options. Finally I approach mastery. Every morning I scream at the mirror "My scripts may never work on the beasts system and his name is the mac"
Richard Stallman is bloated
this is true
It's all those toe-nuggets
What you refer to as Richard Stallman is actually GNU/Richard Stallman or as I have taken to calling it, GNU + Richard Stallman
@@hrishikeshlearning3273 And GNU / Richard Stallman doesn't "open" jars, he "frees" them!
Core utilities work differently on other operating systems. For example, on Windows they don't work at all!
You now did proof that linux is absolutely bloated and if you want to change it, delete all of it. Congrats.
@@Booming-letsplays Computers are all bloat essentially. Books, abacuses and pen and paper are enough.
@Илья Макарчук but they do...
@@ilyamakarchuk books? when you could memories? abacuses? what's wrong with using your mind? Pens? PAPER! unnecessary luxuries.
@@AlucardNoir unironically this
Looks like Luke is off his meds again.
Get woke don't drink tap water out of plastic.
@bws floride is a neurotoxin
all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle all these squares make a circle
What the fuck are you even doing all the way down here? Are you crazy? :P
@@SomeAngryGuy1997 are you aight mate?
@@SomeAngryGuy1997 'make a circle all these squares'. Message received.
269 videos?! Your channel is bloated my man
2Nice
@@abdulwahabjag allcaps and+question mark==bloat
@@abdulwahabjag bloat.
'?' + "!" ? bloat.
is better.
Only Cormac McCarthy can write non-bloat English.
8:28 what a boomer moment :D
No one:
Luke: temple OS is BlOaTeD
That's why Terry released the 2mb Lite ISO
@@dumbcatposter anything more than 1mb is bloated
Temple OS is bloated, make your own kernel !
Video 1: Bash is bloated.
Video 2: Gnu is bloated.
Next video: Real life is bloated.
@Joel Silva i get like that when i get no fiber at all.
@Joji
Thanos was on to something
We need lite version of solar system
TIPS:
1. Most Linux distributions come with both GNU and POSIX manpages. When writing POSIX compliant scripts I always check POSIX manpages for all the supported options. `man 1 cmd` - GNU manpage; `man 1p cmd` - POSIX manpage.
2. POSIX way of doing sed -i:
$ create temporary file (mktemp is not in POSIX, POSIX ways of creating temp files is to use noclobber or mkdir -m 700 with randomly generated name)
$ sed '...' file > temp_file
$ mv temp_file file
3. I recommend creating that temporary file in the same folder - not in /tmp etc. Reason for this is that mkdir and mv (when both input and output paths are on the same filesystem) are the only atomic filesystem operations. If we create temp file in /tmp and then do `mv` it might do `rename` internally or it might become `cp + rm` combo - and cp is not atomic.
Example:
$ create temp_file
$ sed '...' file > temp_file
$ cp temp_file file
This way might leave you with damaged file if you stop cp in the middle of copying. mv (if and only if both input and output paths are on the same filesystem) turns into `rename` which is atomic and this guarantees us ACID - our file will never get corrupted, it will either get updated completely or not at all.
Is it ok if I do not create temp_file but directly output to it (command > temp_file) ? It automatically creates temp_file for me
@@firstnamelastname7248 Yes and no. Depends what you really want/need.
1. If you do not need to protect yourself against parallel execution then it is OK.
2. But if you do run script twice in parallel (and they will use same name for temp_file) then they both will create the file and fight against each other.
3. One of the solutions could be to use noclobber option like I mentioned `set -C`. This way redirection cmd > temp_file will fail if the file already exists, so one script will create a file and proceed corectly and the second script will fail.
4. The question is then how to handle that fail: you can use `set -e` and then your script will simply exit with failure, or you can put cmd > temp_file in a loop until it finally succedes preferrably changing the temp_file name randomly to avoid clashing with other parallel instance of the script.
You may find the posix manpages are in their own package for example on debian you need to install the manpages-posix package
intredasting. thanks!
@@dlarge6502 What happens if you try the *man p1* trick without those packages available on the system? Does it throw an error or does it just show the local (potenteially non-POSIX) manual?
Just switch to BSDs already, we all know that you're going to end up using one of them in the near future
tbh
That thing I was thinking what the heck not BSD??
He can't because of how much he love that redhat paycheck, he's just an IBM/redhat/systemd shill
@@puyatecla9903 he doesn’t even use systemd
Or this this a wooosh
@redwill17 lmao
Sooner or later, you're going to end up reading the Unix Hater's Handbook.
No, he's going to end up writing the sequel.
@@AlucardNoir Unix, the Proper Way
Luke is bald Lunduke confirmed
Terry Davis was right.
@Joel Silva True!
is right
bash is bloated
GNU is bloated
next up: Linux is bloated
By definition yes it is.
of course linux is bloated but i like bloated.
It is.
people who commented "it is" are autistic. period.
But of course
Linux is a monolithic kernel and as everyone knows monolithic is synonymous with bloated
I’d just like to interject for a moment. What you’re refering to as Linux, is in fact, GNU/LInux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux
This is going to be a terrific copypasta
@@jamesthompson7694 wdym this is already copypasta for a couple of years
@@paulvorderegger1522 I know
It’s Linux… not GNU/Linux. Accept.
No, Richard, it's 'Linux', not 'GNU/Linux'. The most important contributions that the FSF made to Linux were the creation of the GPL and the GCC compiler. Those are fine and inspired products. GCC is a monumental achievement and has earned you, RMS, and the Free Software Foundation countless kudos and much appreciation.
Following are some reasons for you to mull over, including some already answered in your FAQ.
One guy, Linus Torvalds, used GCC to make his operating system (yes, Linux is an OS -- more on this later). He named it 'Linux' with a little help from his friends. Why doesn't he call it GNU/Linux? Because he wrote it, with more help from his friends, not you. You named your stuff, I named my stuff -- including the software I wrote using GCC -- and Linus named his stuff. The proper name is Linux because Linus Torvalds says so. Linus has spoken. Accept his authority. To do otherwise is to become a nag. You don't want to be known as a nag, do you?
(An operating system) != (a distribution). Linux is an operating system. By my definition, an operating system is that software which provides and limits access to hardware resources on a computer. That definition applies whereever you see Linux in use. However, Linux is usually distributed with a collection of utilities and applications to make it easily configurable as a desktop system, a server, a development box, or a graphics workstation, or whatever the user needs. In such a configuration, we have a Linux (based) distribution. Therein lies your strongest argument for the unwieldy title 'GNU/Linux' (when said bundled software is largely from the FSF). Go bug the distribution makers on that one. Take your beef to Red Hat, Mandrake, and Slackware. At least there you have an argument. Linux alone is an operating system that can be used in various applications without any GNU software whatsoever. Embedded applications come to mind as an obvious example.
Next, even if we limit the GNU/Linux title to the GNU-based Linux distributions, we run into another obvious problem. XFree86 may well be more important to a particular Linux installation than the sum of all the GNU contributions. More properly, shouldn't the distribution be called XFree86/Linux? Or, at a minimum, XFree86/GNU/Linux? Of course, it would be rather arbitrary to draw the line there when many other fine contributions go unlisted. Yes, I know you've heard this one before. Get used to it. You'll keep hearing it until you can cleanly counter it.
You seem to like the lines-of-code metric. There are many lines of GNU code in a typical Linux distribution. You seem to suggest that (more LOC) == (more important). However, I submit to you that raw LOC numbers do not directly correlate with importance. I would suggest that clock cycles spent on code is a better metric. For example, if my system spends 90% of its time executing XFree86 code, XFree86 is probably the single most important collection of code on my system. Even if I loaded ten times as many lines of useless bloatware on my system and I never excuted that bloatware, it certainly isn't more important code than XFree86. Obviously, this metric isn't perfect either, but LOC really, really sucks. Please refrain from using it ever again in supporting any argument.
Last, I'd like to point out that we Linux and GNU users shouldn't be fighting among ourselves over naming other people's software. But what the heck, I'm in a bad mood now. I think I'm feeling sufficiently obnoxious to make the point that GCC is so very famous and, yes, so very useful only because Linux was developed. In a show of proper respect and gratitude, shouldn't you and everyone refer to GCC as 'the Linux compiler'? Or at least, 'Linux GCC'? Seriously, where would your masterpiece be without Linux? Languishing with the HURD?
If there is a moral buried in this rant, maybe it is this:
Be grateful for your abilities and your incredible success and your considerable fame. Continue to use that success and fame for good, not evil. Also, be especially grateful for Linux' huge contribution to that success. You, RMS, the Free Software Foundation, and GNU software have reached their current high profiles largely on the back of Linux. You have changed the world. Now, go forth and don't be a nag.
Thanks for listening.
Everything but a typewriter is bloat.
Luke:
GNU is bloated, be suckless my viewers
Also Luke:
Use systemd my viewers
I agree with 99% of this video - the 1% I disagree with? the "is bloated" part.
A funny guy
Luke : use free software
Also Luke : GNU is bloated
😂😂😂
I'd just like to interject for a moment. It is GNU plus Linux, Luke
Ganooo plas Linooks
I inherit all my prejudices from cat-v.
my prejudices are cat-v compliant
No one:
Luke: Atoms are bloated
Luke:
*sed -i* does work in BSD. At least in OpenBSD. From its manual:
" *-i* [ _extension_ ]
Edit files in place, saving backups with the specified extension. If a zero length extension is given, no backup will be saved. It is not recommended to give a zero length extension when in place editing files, as it risks corruption or partial content in situations where disk space is exhausted, etc. In *-i* mode, the hold space, line numbers, and ranges are reset between files."
Maybe not exactly the same, but many times, the same in practice.
Plan 9 and Plan 9's utilities aren't POSIX-compliant. If something in it happens to be, it is rather by coincidence than by conscious effort. The cat-v crowd doesn't generally like POSIX.
And writing your scripts in, say, rc shell (Plan 9's) would make your scripts much less portable, as the users would have to install plan9port to use them.
One last thing: have you tried acme(1) more extensively as of late? It may be a bit of an acquired taste, but I seriously think you can like it a lot.
Great tip thanks!
Why i feel like Luke is just realizing that minimal software and Unix philosophy are Memes, and he's gonna switch to Ubuntu with Gnome the next video
--posix disable all GNU extensions.
--posix is a GNU extension. That's the problem.
@@LukeSmithxyz lol 😂🤯
@@LukeSmithxyz not having the flag does not mean automatically that is POSIX compliant. Also commands should not overlap, GNU versions should be gnu-sed, gnu-awk, etc. like gawk and so forth they present themselves as different.
Let's be real... Richard Stallman is bloated.....
literally
You might want to rename your channel as "Bloat TeeVee". Or "The Love Bloat"...
inb4 luke smith is harmful page on cat-v
What do you mean by concatenate? I use cat as my text editor, everything else is too bloated.
Makes sense. Just don't ever have a typo
You know, the SHITTY thing is, apparently alot of thees things are quite handy (otherwise you wouldnt use them) but instead of adding similar
"GNUisms" to POSIX aaaaaanything, even the good stuff, thats developed on/for Linux is vehemently ignored by the rest of the "Unix world"...
Oh boy would it be terrible if those Mac users had actually convenient shell commands, right?
I say, embrace the good stuff (feel free to hate on things that are actually terrible ofc) and if others dont want to improve, hf debugging.
I mean, last time ive checked all of this stuff was still open source.
A) I don't think you'd miss anything if you were on a Mac. + As mentioned in the video BSDs and Mac also add their own extensions that can be just as good as the GNU ones just with different syntax.
2) You can just run the GNU utils if you prefer them on macOS or whatever.
3) Source code being available doesn't mean easy adaptation. The GNU Core Utils are made pretty portably, but a great tool like diskutil on macOS unfortunately can't easily be ported to Linux even with full source code availability
C++ is bloated. Change my mind.
C is bloated. Change my mind
ansi c ftw
Its worth pointing out that the GNU utils maybe bloated but, GNU's Not Unix ;)
GNU was written to be "upwardly" compatible with UNIX. So it can do UNIX (POSIX) stuff and will be compatible with it. I think Stallman went this route so he could avoid having legal battles based on his OS being a UNIX (all the battles between those who claim to own UNIX are fun reading).
Also when he started writing GNU he had never even used UNIX. Its great he chose to be compatible with it and to write GNU to target the 32 bit cpu's (the 386) that he was sure were going to be the most popular architecture.
The Linux kernel is bloated
linux-suckless
- No more unnecessary LKMs out of the box.
- Specialized for your hardware.
- Fast as fuck.
- All written in Assembly
The coreutils are like that and get features because of convenience. SOme tasks are unnecessarily complex to implement otherwise or would need needless reimplementation by each damn user because Coreutils doesn't come with a complete solution.
This problem with different "vendor" versions of some tools behaving differently only pertains users that try to port scripts to other OSs or use different OSs with different vendor versions of those tools.
I think the existing solution (expanding the Coreutils' functionality) does much more good than bad in comparison to not doing it and keeping them all the same on all OSs. Some tools also _need_ to behave differently because of different APIs (E.g. ifconfig on Linux, ifconfig on 'BSD).
the problem is they don't SAY what is their own convenience feature...
people assume that because it's not said otherwise, stuff like cat -v would work on other posix-compliant systems...
also unix philosophy is to do one thing only, which is why utilities like `nl` are separate, and `cat -n` shouldn't be a thing...
etc, etc...
I absolutely agree with you. i think even Luke would rather use the -i arg rather than output changes in file.new and replace file.old by file.new .
But i don't think that this video is really a rant about the huge list of argument or even that he is defending the cat -v team.
I think he just used the word "bloat" because it's a meme at this point but really he wanted to say that not all unix are made equal and that just like with higher level langages, if you don't have the same version of the lib then your code is not portable.
In this case bash and gnu core utils are not the same everywhere
I mean you cooouuuulld use ed instead of sed and get around the edit-in-place problem....but still...
and yeah that's a problem, but there's a solution... busybox! ;P
statically compiled busybox against musl or something like that, and boom, ya got most everything you'd need ;)
Richard Stallman wants to know your location.
And then again, he doesn't (because that would be a violation of his principles)
I will say, I am fond of many GNU coreutils innovations. The one kinda annoying thing is their tar, GNU tar is cool for personal archives, but often really annoying when you don't want some of the features. Sometimes you don't want your tarball to preserve your "immutable" or "append-only" extended attributes.
cat file | sed "s/FILE/file/g" | cat > file
I am not sure why, but this works
In my experience with other Unix utilities (find, grep, see, awk). GNU utilities are much faster. if I'm using a Unix OS like Solaris, I prefer using the GNU utilities.
GNU/bloat
Bash bloated
GNU bloated
really interesting i want to see more..
Kernel is bloated :P
Next Video: The Linux Kernel is Bloated!
It actually is, and the first one to say it is Linus himself.
Hah, I see what you did there, GIMP = Green Is My Pepper
Thought is was Gimp Isn't Microsoft Paint
@@corey8704 it’s GNU Image Manipulation Program, but the green is my pepper thing is from an email someone send to stallman, he didn’t know what gimp was and they used the green default pepper in GIMP to show that they where using free software, and stallman erroneously assumed that GIMP means Green Is My Pepper.
@@tylerdean980 missed the joke.
From Mac to GNU+Linux to use sed. RMS win
Luke is on his way towards OpenBSD :-)
Random comment about this... when you had the man page open for sed I noticed that there is a --posix flag, so you could test with all GNU extensions disabled which could be helpful for making a posix compliant version on a GNU version of a utlity (assuming it is common across other utils)
Awesome video as always :D
Yeah but if you run that flag on FreeBSD commands probably will crash.
@@Joe3D Ideally you wouldn't put it in your scripts. You _could_ set the flag using an alias, but then that might break other things that rely on GNU extensions...
Hey Luke, have you ever thought about the fact that the birth of Unix and Unix-like operating systems as we know it today was essentially the result of an epic gamer moment? Ken Thompson was perhaps the original oppressed gamer. I'd like to see a video on your opinions on this subject.
I know you are joking but this is unironically a good point.
@@NicolasGoulart42 how so
@@NicolasGoulart42 how is it the case
@0:05 Skip the sales pitch, it is just Linux. :)
posix is good if you have to be portable, for example in an opensource project which supports multiple platforms, but for anything else on linux, please use bash and the gnu utils. it makes your life way easier. don't go back to the 90's!
Perhaps we should all be reminded that GNU is *not* Unix
there is no system but GNU and Linux is one of its kernels
Hail Saint iGNUcious!
No, no, no. It's:
There is no system but GNU and Linux is it's one true Kernel.
Is this the shahada ?
all hail GNU/HURD
Just make sure you don't draw a picture of the kernel or the extremists will bomb you.
"Cat outputs a file to your terminal"?! Don't you know that _less_ is _more?!_
Probably use printf.
lmao i knew he would stumble upon cat-v when he started going on about systemd
He talked about cat-v in a video 5 months ago.
Strictly speaking, any program that can do more than one thing is bloat. Bloat is necessary for us to work quickly. For humans to work with computers.
Processors are bloated. Do the processing in your mind
Luke is so bipolar ngl
Less harmful alternatives: Go ... wtf, who wrote this
based
Linux users will punch their wife's stomach because it looks bloated.
Just kidding LOL XD
>linux users have wives.
Women are bloat.
Since there's no binary compatibility between FreeBSD / OpenBSD / NetBSD / GNU Linux / MacOS there's no fuss with why GNU Linux commands offer more options than other :)
There's a reason there were UNIX variants in the past.
>cat-v
into the trash it goes with uriel
At least Uriel understood life was bloated.
Considering I will never use any BSD, Mac or UNIX, gnu modifications are good. I like your videos very much, but to me gnu is good enough
Who cares about other operating systems? The only operating system besides GNU/Linux that I care about is GNU+Linux.
When invoking sed you will want to use the -posix flag in order to disable all GNU-specific extensions and allow for portability.
Well if Richard Stallman would lose weight I think that would be a good start. Said the overweight man.
But the problem was just caused by enthuasm. I wrote some unix utilities as an excersice when I was learning C and while you are writing them, all these good ideas keep popping into your head, like when you do the option to append, you think, "why not add an option for the line-before-last" and so on. All those bloated options are written by programmers who were just bubbling over with good (and sometimes not-so-good) ideas! It's just something we have to live with. You can't stop people trying to improve things. It would be wrong.
A little nitpick - Plan 9 tools aren't minimally POSIX compliant; POSIX makes a number of compromises and accounts for common extensions that arose amongst GNU and multiple free and proprietary unices, so they could have vague source-level compatibility. Half the point of Plan 9, meanwhile, was to make a clean break in userland. They've got their APE subsystem, the “ANSI/POSIX Environment”, but that's another story.
posix may be the spec standard but Linux and its cadre of gnu tools is by now the predominate defacto standard for Unix flavored OS; i.e., more books are sold on instructing how to use gnu tools on Linux than books on, say, FreeBSD or the command line tools of the shell on Mac OSX
Not really. You'll have issues porting between different distros.
If you write a non POSIX script for arch it will NOT work by default on Debian. Takes only a small modification to make it work on Debian bit then you have a performance hit
There is a way better example than this: glibc. Glibc is considered by far the worst C library existing, for a very good reason: it's bloated, and is intentionally bloated. It is also very backwards-incompatible and all that to prevent people from static linking. Another good example is GCC, LLVM is a thing today because GCC is intentionally bloated and has developer unfriendly characteristics. With GNU, as always, it's a matter of phylosophy, you either embrace it, like I do, or you will find something which is inconvenient. I find this very consistent with their battles and I honestly admire them for estabilishing standards left and right while pushing forward their ideals.
problem is that GCC is basically the best compiler around, for now, even if only because of its age...though LLVM's clang isn't too far behind (I've got no modern stats to prove any of my claims though)
and did you mean all of LLVM, or only clang?
@@jan_harald Clang, should've specified. LLVM is obviously useful for other things XD
I guess you mean dynamically link to older versions.
@@jan_harald clang is not Free Software hence companies like Apple improve it and don't give back code. That's why Apple switched from bash to zsh, they change and bundle it only in binary form.
Computers are bloated, you should use stick and stones
Better oral tradition and no written language.
Instead of utils he says yoodles. First time ever hearing this XD
I'm a total GNU nut, but I can totally agree. GNU utilities come with way too much fluff.
I pronounce "Core Utils" with more emphasis on the I, like "you-TILL-s" as in "uTILity". Is this just a preference or is it really "Core-yoodles"?
Ohh cat-v.org from Uriel, thanks for still showing that page. It's not possible to understand suckless.org without him, he was very involved in wmii/dwm/and other tools and advices. Descansa en pau Uriel. R.I.P
Meanwhile I use github.com/sharkdp/bat
because bloat is love, bloat is life!
Life's bloated
I'm a bit late for this, but Plan9 is not about POSIX compliance. Like not at all. The system utilities are even written with Plan9's own "standard" library of C functions. The reason the Plan9 utilities are considered "non-harmful" is because they implement only the functionality they need to in order to do their job effectively. It sounds like you may have read this paper (harmful.cat-v.org/cat-v/unix_prog_design.pdf) before making this video, but if you haven't it explains the perspective the designers of Plan9 had when writing the system.
Also, the Plan9 cat program does have two options, -m and -n, while the POSIX standard cat has one option, -u. You didn't notice them because Plan9 manpages aren't formatted like we are used to, with each option as a separate subsection.
Plan 9 cat doesn't have options.
Me not using GNU/Linux 'cause musl/toybox/llvm exist
What's wrong with:
sed 's/file/FILE/' file > file
?
Good question. It will be trying to read from the file you are overwriting line by line! The result will be deleting or blanking your file I believe.
@@LukeSmithxyz exactly, that's kinda annoying to have to make temp files like this, though...
unless you somehow load all of the file into memory, and THEN pipe and replace the file...
I know `mv text.txt.new text.txt` is basically instant, but I dislike such "useless" temp files on principle...
imho temp files should be used in some way and not just moved to different name...(such as splitting it up, or editing further, or something...)
`cat file >file.new ; mv file.new file` is bloat... (sed or whatever is same...)
@@LukeSmithxyz It does blank the file, but that is simply because opening a file for writing in UNIX blanks the file.
But what I was trying to do is evil anyway since
sed 's/short/veryverylong/' file > file
would print garbage regardless.
In any case, here's how you would do you it on Plan 9 (using rc syntax):
echo '{sed `s/file/FILE/` file} >file
Using the uglier Unix sh syntax this would be something like:
echo "$(sed 's/file/FILE' file)" > file
So what's better about this? Simple: if you write programs you have to write less code. If you use programs, you don't have to worry about sed implementing '-i' correctly.
the GNU version of YES(1) is 10 trillion loc, but its the only one that will come close to maxing out your IO with the number of y prompts
use busybox's versions when possible ;P
busybox is dope, and doesn't do the extra options...
Busybox is for smartphones, they don't even include nmanpages.
You can use the commands with --posix flag to disable GNU extensions.
Probably will fail on FreeBSD commands like "Invalid flag"
1:19 "I use the GNU çuçk coreutils..."
2:18 Among just like Among Sus Laughing
Saying stuff is bloat, is very bloated. Blah ha ha
A small addition, you can compile GNU utilities on your own so they are strictly POSIX compliant.
Luke your sunglasses are bloat.
For in-place editing, I suggest ed - the unix editor
But the info page totally mentions how -i in sed is not posix compliant and then says there is another option --posix which will limit the functionality of sed to posix compliant and the environmental variable, or how you can set POSIXLY_CORRECT (cause --posix would break the other sed(s) I guess)
6:23 the correct way is to use ed(1) in your script if you have to edit a file.
except f*in debian removed it from the standard setup...
do those morons not know it's the standard editor...
smh...
;P
Technically, GNU was a project to make an independent and FOSS version of Unix, and they had worked on the core utils for a while, but never got to actually making the kernel.
But then Linux showed up, and they went with that. So the GNU core utils wasn't made for Linux, it was made for GNU, but then they went with Linux as the kernel and helped each other out.
you know if you are a hammer every thing looks like a nail
mac has its own flags. Bsd as as well. I prefer to use the feature rich one. If you are aiming multi platform stuff, use a programming language like perl, python, ruby. Otherwise you have to live with that.
Why did you quote the command for sed (like: $ sed 's/file/FILE/' file)?
I think there is no blob and other special character of shell in that command line.
it's a good habit though
just like you could do
echo hello there...
without quotes, but's it's a good idea to always quote, just in case...
which browser is that?
Then why dont you just create your own core-utils if it pisses you of so much that gnu core-utils are a couple bytes bigger than their unix-equivalent
"You'll need to write it to another file and then bla bla bla..."
My man what you want is just:
sed 's/FILE/file' file > file
Try that and find out what happens.
@@LukeSmithxyz well... guess I was wrong.
BTW just found out a way in which that approach can work.
sed "s/FILE/file" | sponge file
You'll need moreutils package thou.
by the time sed is executed file is empty because redirection happens before execution and truncates file. Instead run echo "$(sed s/file/FILE/ file)" > file
Reality is bloated!!!
A few years ago, I went through the exercise of installing and having the Plan 9 coreutils in my path prior to the GNU coreutils and found that running almost anything that I hadn't explicitly written myself became a monumental pain in the backside. So I uninstalled the Plan 9 coreutils to remedy the issue; I might play with them again on a non-critical system at some point.
I think I was pretty late to the game on discovering the GNU sed easy mode -i option. I used "sed 's/pattern/replacement/' file > /tmp/file && mv /tmp/file file" all the time before my enlightenment. (And yes, there was much data loss since all of my files were named file. It was the dark ages, what can I say?)
I know this is old, but the plan9 coreutils aren't POSIX compliant, the coreutils used in *BSD would be better for that.
I know this is old, but...
1) With BSD sed, if you don't want to store a backup when doing inplace, you can run it as [sed -i '']
2) For inplace sed, gnu's --follow-symlinks option is nice. Normally, sed -i clobbers a symlink with a regular file and leaves the linked-to original file alone. Obviously, follow-symlinks tells it to work on the linked-to file.
Let's be honest: nobody cares about other OS except of MacOS and BusyBox. BTW the BusyBox is a really good less bloated alternative for GNU coreutils
I don't think that scripts should ALL be posix compliant. POSIX is rather old, limiting and akward at times, so i mostly try to stay posix compliant since it isn't hard for most tasks, but when some certain addition can save me a few dozen minutes or even hours? Yep, i am taking it and never looking back.