We're talking about standards that were published in 1992-1994 and that the overwhelming mass of the industry followed relatively quickly. To hold back 25 years later is nuts.
If you are generating a script that has to run everywhere, yes have the backend emit the verbose or tricky or unergonomic construct. But most of time, breaking portability to have something that is easier to understand, or more regular, that uses modern facilities is almost always the correct solution.
What's "everywhere", anyways? We'll have a hard time even finding a system this won't work on.
Especially in the context of FPGA tools that will only run on modern Linux, anyways...
Right, annatar doesn't actually care that his "advice" here is completely wrong and irrelevant. His only goal is to derail any useful discussion in order to point out how smart he is and how terrible any software that isn't included with solaris 8 is.
I have sympathies for the arguments. It's kinda unfortunate that Linux has taken over everything and we don't have real portable code anymore and other Unixes find themselves on the margins. x86, even x86-64 isn't really "clean". Way too much of the software ecosystem is willing to be on the bleeding edge. I worry we're losing core bits of Unix philosophy / simplicity as things evolve. Etc.
If the arguments were completely untrue, they'd not find any purchase. But this guy is running around kicking the hornet's nest whenever possible.
And also, I have no fear of hornets or their sting; I've been stung enough times. I have never cowered and I'm not about to start now.
To add insult to injury, I am forced to work deep in the bowels of Linux and various GNU tools like GCC because of the current market conditions, so I get to "live the dream" every day. I want things to change, and I'm doing something about it, the best way I know how, which is by raising awareness, just like all the Linux people did back in the '90's and early 2000's.
I've loved Solaris, NetBSD, and Irix. ZFS is pretty cool.
But it'd be pretty easy based on your posts to conclude that the only people who still advocate for that stuff are wrongheaded, pedantic curmudgeons.
In the meanwhile, notice how absolutely no one could explain what's wrong with || exit 1, other than it's "ugly" (which is a personal opinion, not a fact)?
"You can't even admit your mistake."
So let me get this straight: because I was wrong about set -e making one's program instantly unportable, my entire argument that SmartOS is a good, fast product is invalid? I guess the implication here is that because I was wrong about set -e making a shell program unportable, I am wrong about everything else, is that it?
set -e is a stylistic choice, though one I'd urge anyone writing scripts in Bourne and Bourne-like shells to prefer by default.
A while back I even tried to encourage him to explain HOW zones are better with real examples instead of just shitting all over a how-to mentioning docker. He instead attacked me and said it wasn't his job to teach anyone anything. Awesome job, the only thing anyone learned from that thread was that SmartOS users are assholes.
What's left of solaris is dying and he is helping in every way he can.
Sad to read this after having taught so many information technology professionals over the three decades, some of them in the heart of Silicon Valley. What I probably told you is that I don't owe you anything, which is still true. You disrespected me and attacked me several times. Why should I teach you?
As for the "what's left of Solaris is dying" "argument", I would be careful to make such statements, as they reek of casual usage: SmartOS isn't Linux; one deploys it because one has understood his advanced capabilities and features Linux doesn't have, to do a job and do it reliably and easier than with Linux, not because it's a good old buddies club where we comb our Ken and Barbie dolls and drink-pretend to have tea at 4 o' clock. If you want an echo chamber, stick with Linux; if you need to do a job, read the SmartOS manual pages, then come back with concrete questions. I'm not about fanboyism and casual usage, "community" and all that "Stack Overflow" nonsense.
Now, with all of that out of the way: what do you need help with in SmartOS?
Outside Oracle, the various efforts to use OpenSolaris derived stuff are constantly fragmented and overall shrinking in size. What little effort there is to improve things is often duplicative between the three+ branches of effort. Hardware support is more marginal than ever on OpenSolaris derived stuff.
Less and less important software compiles under and works well under it, and it's getting harder and harder to run.
That's funny, because I'm on the mailing lists for illumos and SmartOS and I see that everything generally useful impemented in SmartOS ends up upstream in illumos. Do you have any evidence to support your claim?
It's true that less and less software compiles on Solaris 10. I have to spend time patching badly written software to get it to compile. I have however not noticed any performance impact, on the contrary, that same software runs faster on Solaris 10 (and by extension illumos and therefore SmartOS) than on GNU/Linux where it has been developed, which is a slap in the face of GNU/Linux crowd hacking on that trash fire.
SmartOS is a different story, completely different: they use pkgsrc and their library is 15,000+ packages. So the argument here is mis-information. Presumably, this is being done on purpose, "because Linux"?
You may need 'showdead' on.
And I'm not your "bro".
I've learnt a lot from you. The original Bourne shell didn't support set -e. set -e is a bashism. Depending on a posix shell is unreasonable. This has something to do with Linux.
Wait, none of these things are true.
> because on Solaris /bin/sh is the real McCoy - Steven Bourne's shell from 1972 - 1977.
vs. v7 Linux from 1977-1978 including set -e. You're hilarious, bro.
And I'm not your "bro". Are you in need of an older brother so badly?
Disabling XQ
boot
Boot
: hp(0,0)unix
mem = 2020544
# RESTRICTED RIGHTS: USE, DUPLICATION, OR DISCLOSURE
IS SUBJECT TO RESTRICTIONS STATED IN YOUR CONTRACT WITH
WESTERN ELECTRIC COMPANY, INC.
WED DEC 31 19:15:05 EST 1969
login: root
Password:
You have mail.
# set -e
# true
# false
login:With the exception of GNU autotools, I know of no backends which would emit shell programs. People write programs in shells.
But in this case I know of
https://github.com/BYVoid/Batsh
and
Autotools is written in M4.. M3/M4 were developed by K&R to help automate generating mostly shell programs. In 1974-1977.
For someone who purports to be so oldschool, you're sure missing a lot.
M4 would excel at this adaptation...
Which isn't even necessary, because everything posix conformant has "set -e". And if "posix" isn't good enough, the Bourne Shell back to 1978 has it (probably earlier).
You are hilarious, bro. :D
And I'm not your bro.
I know this was a thing 20-25 years ago, but is it still a problem now?
I know that "#!/bin/sh" and "set -e" will work on all the BSDs, Solaris, Linux, macOS, what Unix is realistically left?
But TBH, keeping that script (that I wrote in 60 seconds) nice and clean was the least of my worries... Making the damn toolchain work had far, far higher priority :-)
And after that, booting the LEON cores of course.
Up until the latest Solaris 10 patches, /bin/sh and /sbin/sh did not implement set -e, because on Solaris /bin/sh is the real McCoy - Steven Bourne's shell from 1972 - 1977. There is a fully POSIX compliant /usr/xpg4/bin/sh, but only Solaris experts know that the /usr/xpg4 directory exists and what is in it; 99.99% of the people out there won't have it before /bin or /usr/bin in their PATH.
Portability should never be traded for convenience, because when one does that, one forces "the next guy" to waste his time fixing one's code. That's just wrong. I've had so much of my life wasted by GNU/Linux "bashisms" which were completely unnecessary. I resent that deeply. That's my life I could have spent in more productive and fulfilling ways, rather than fixing what should not have been broken to begin with.
If you want to write portable shell programs, write them in ksh and then you won't have to worry about POSIX or non-POSIX.
There's been a conformant POSIX shell on Solaris since 1995.
/bin/sh has been conformant to this since 2007 or so.
It is 2019. When should we be allowed to use it?
POSIX is the standard for Unix portability and has been for the last 2 decades. System V never was.
> Portability should never be traded for convenience, because when one does that, one forces "the next guy" to waste his time fixing one's code. That's just wrong. I've had so much of my life wasted by GNU/Linux "bashisms"
"set -e" is not a bashism. The errflag was there from nearly the beginning. By the early 1979 BSD 3 development tree, it could be triggered by 'set -e'. When the POSIX standards committee decided to iron out differences between the BSD and SystemV branches of the Unix Family tree, they decided it was worth keeping, and over the next few years everyone conformed.
> Portability should never be traded for convenience, because when one does that, one forces "the next guy" to waste his time fixing one's code. That's just wrong. I've had so much of my life wasted by GNU/Linux "bashisms" which were completely unnecessary. I resent that deeply. That's my life I could have spent in more productive and fulfilling ways, rather than fixing what should not have been broken to begin with.
There's also things that are good for everyone else's productivity-- by e.g. not catering to someone who is stuck 18-40 years in the past.
Wow-- I hadn't realized just how wrong your argument was! Bourne's shell from the outset supported set -e!
From Bourne's "An Introduction to the Unix Shell", ~1977-1978 (converted to HTML at http://porkmail.org/era/unix/shell.html )
> The shell flag -e causes the shell to terminate if any error is detected.
and the document goes on to state that you can use 'set' to set shell flags.
It's in the V7 source, too:
CHAR flagchar[] = {
'x', 'n', 'v', 't', 's', 'i', 'e', 'r', 'k', 'u', 0
};
INT flagval[] = {
execpr, noexec, readpr, oneflg, stdflg, intflg, errflg, rshflg,
keyflg, setflg, 0
};
Along with a proper call to options() in the set builtin.If the basis of your whole argument is history, you're complaining about something that would have worked on V7 or 3BSD. :D Apparently they are "too new."
edit: Running V7 on a PDP-11 emulator has the anticipated results:
boot
Boot
: hp(0,0)unix
mem = 2020544
# RESTRICTED RIGHTS: USE, DUPLICATION, OR DISCLOSURE
IS SUBJECT TO RESTRICTIONS STATED IN YOUR CONTRACT WITH
WESTERN ELECTRIC COMPANY, INC.
WED DEC 31 19:15:00 EST 1969
login: root
Password:
You have mail.
#
#
# set -e
# false
login:You speak in absolutes.
Very dated absolutes as well.
You might want to think about that.
Solaris 10 release date: January 2005.