WTF Bites
-
@dkf well, I can't think of any other way it could be done. Of course TRWTF is the entire idea of shebangs.
#! /my/very/long/path/to/perl --with --all --the --required --options exec /my/very/long/path/to/perl --with --all --the --required --options $0 $@ if 0; # actual script goes here
-
Urge to kill...rising...
new Integer(15)).intValue()
-
@boomzilla Obviously what they meant was
Integer.parseInt(new Integer(15).toString())
-
Got a screen shot of an excel file from customer. It shows content out to column
DNG
(). Apparently they haven't been able to open this file for several days and have IT guys trying to recover an earlier version (I suspect it's been stored on a shared drive so maybe there's a backup somewhere).Tried to open with libreoffice and it gives up at column
AMJ
, warning me that there are too many columns.They are fucked. And retarded.
-
@boomzilla said in WTF Bites:
libreoffice
-
-
@boomzilla said in WTF Bites:
column DNG
@boomzilla said in WTF Bites:
column AMJ
Fucking hell. I didn't realise Excel even allowed that many columns.
-
-
@loopback0 said in WTF Bites:
1,048,576 rows by 16,384 columns
Not to worry, DNG is not quite 16384 columns, and the sh[i|ee]t is already broken.
-
Not to worry, DNG is not quite 16384 columns, and the sh[i|ee]t is already broken.
Yeah, although I'm also certain the sheet goes much farther than that. DNG was just the last column in the screenshot I received.
And since they password protected this file () I can't go in and look at the raw xml and recover stuff that way either.
-
@boomzilla holy fuck where did this file come from? Was it generated?
-
@boomzilla holy fuck where did this file come from? Was it generated?
all files are generated
-
@boomzilla holy fuck where did this file come from? Was it generated?
Yes, generated. By idiots.
It's basically a calendar that started on September 1st 2016 and goes to...sometime in the future. Every week day has 4 columns.
-
@boomzilla I'm honestly speechless. I think you might take the crown for dumbest thing I'll hear all year.
-
@DogsB it's February, give it time.
-
@pie_flavor said in WTF Bites:
@DogsB it's February, give it time.
Not sure if I should call you optimist or pessimist
-
@TimeBandit said in WTF Bites:
@pie_flavor said in WTF Bites:
@DogsB it's February, give it time.
Not sure if I should call you optimist or pessimist
Yes.
-
Well someone didn't test their shit even once.
-
@boomzilla Did you link to that tweet because your Monday sucked or because your customers make as little sense as Jeff?
-
@boomzilla Sounds like you got front page material here.
-
@boomzilla Did you link to that tweet because your Monday sucked or because your customers make as little sense as Jeff?
He really loves lasagne.
-
-
@TimeBandit said in WTF Bites:
@pie_flavor said in WTF Bites:
@DogsB it's February, give it time.
Not sure if I should call you optimist or pessimist
Optimally pessimistic.
-
@boomzilla said in WTF Bites:
Got a screen shot of an excel file from customer. It shows content out to column
DNG
().How did that even fit? Even 1-pixel columns might not be enough…
-
@dkf well, I can't think of any other way it could be done. Of course TRWTF is the entire idea of shebangs.
#! /my/very/long/path/to/perl --with --all --the --required --options exec /my/very/long/path/to/perl --with --all --the --required --options $0 $@ if 0; # actual script goes here
That needs to be
"$0" "$@"
in there so there's no surprises from spaces in directory names. (Yes,"$@"
is magical. Documented magical.) Shell programming is miserable, but there are standard defensive patterns which defuse the main landmines…
-
Shell programming is miserable
Only in miserable shells. PowerShell, for instance, is just fine to work with.
-
@pie_flavor said in WTF Bites:
Shell programming is miserable
Only in miserable shells. PowerShell, for instance, is just fine to work with.
Nope, it's not just fine to work with. It might be better than the old *nix shells, but that doesn't make it fine.
-
@Carnage Disagree
-
@dkf well, I can't think of any other way it could be done. Of course TRWTF is the entire idea of shebangs.
#! /my/very/long/path/to/perl --with --all --the --required --options exec /my/very/long/path/to/perl --with --all --the --required --options $0 $@ if 0; # actual script goes here
That needs to be
"$0" "$@"
in there so there's no surprises from spaces in directory names. (Yes,"$@"
is magical. Documented magical.) Shell programming is miserable, but there are standard defensive patterns which defuse the main landmines…surprised that's all he got wrong
-
@dkf well, I can't think of any other way it could be done. Of course TRWTF is the entire idea of shebangs.
#! /my/very/long/path/to/perl --with --all --the --required --options exec /my/very/long/path/to/perl --with --all --the --required --options $0 $@ if 0; # actual script goes here
I neither understand why this isn't fork-bombing nor what the
if 0;
is doing, though both might be related.
-
I neither understand why this isn't fork-bombing nor what the if 0; is doing, though both might be related.
The
if 0;
on the line is the Perl incantation for “don't run the previous line” (and was the bit I'd forgotten; I don't write Perl very often). Theexec
is shell for replace the current process's executable with this one here. The concept doesn't really exist on Windows, where process launch and executable startup are fused into a single system call.
-
Status: Bobby3 is all alone and feeling left out. But for some reason Jenkins doesn't want to let him play....
Whatever.
-
@TimeBandit said in WTF Bites:
Utility companies being fucking morons isn't news. I'm paying off a backlog bill caused by some epic level of incompetence and every month they tell me I haven't paid, refuse to talk to me when I call, lose account details and eventually agree I have paid and that they won't contact me about it again
-
@Tsaukpaetra said in WTF Bites:
Hypatia Nightly Multijob
Somehow I have a tendency to read that as "Hypatia Nightly Nutjob". My parser must have a bug somewhere.
-
@ixvedeusi said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
Hypatia Nightly Multijob
Somehow I have a tendency to read that as "Hypatia Nightly Nutjob". My parser must have a bug somewhere.
The person who named them lives for descriptive and long names. It actually broke some path limits at one point. I think it was something like "Hypatia Nightly Multijob build chat server, master server, website for publish to cloud"
-
The
exec
is shell for replace the current process's executable with this one here.And I thought shell programming couldn't get any worse... It's been like 9 years since I started using Linux for real, and I'm still learning new mind-boggling things about shell.
Fun exercise: open interactive shell, then enter
exec true
.
-
I neither understand why this isn't fork-bombing nor what the
if 0;
is doing, though both might be related.The
if 0;
on the line is the Perl incantation for “don't run the previous line” (and was the bit I'd forgotten; I don't write Perl very often). Theexec
is shell for replace the current process's executable with this one here.But doesn't the shebang line mean the whole script is always executed by Perl and not by the shell in the first place?!
The concept doesn't really exist on Windows, where process launch and executable startup are fused into a single system call.
Like a sane system that doesn't use
fork
to start different processes because "writing the system call was only 20 lines 50 years ago".
-
Fun exercise: open interactive shell, then enter
exec true
.Uh, huh. What does it do, that you didn't expect it to?
(For those for whom it's not immediately obvious, it effectively logs you out of that shell, since
true
(or whatever command you put in its place) replaces that shell on theexec
, and on exit, er - exits.)
-
Fun exercise: open interactive shell, then enter
exec true
.Uh, huh. What does it do, that you didn't expect it to?
(For those for whom it's not immediately obvious, it effectively logs you out of that shell, since
true
(or whatever command you put in its place) replaces that shell on theexec
, and on exit, er - exits.)That's what I expected. Glad you wrote that because I wouldn't have tried it outside of a VM (), you can never be sure.
-
Fun exercise: open interactive shell, then enter
exec true
.Uh, huh. What does it do, that you didn't expect it to?
I didn't expect anything except
exit
andlogout
to ever drop me out of shell. It is obvious in the hindsight, but it's very surprising if you don't already know about that. It's like learning that in C++,std::bind
acceptsstd::shared_ptr
as the first bound argument of a method - obvious in hindsight, but really throws you off the first time you see it (because you usually see it for the first time trying to track down a memory leak).
-
You could try running
:(){ :|:& };:
in your shell too for some fun!
-
but it's very surprising if you don't already know about that
How/why does one use it without knowing what it does or without realising it? That's its particular thing in the 'do one thing and do it well' part of the Unix Philosophy...
-
but it's very surprising if you don't already know about that
How/why does one use it without knowing what it does or without realising it?
Because they've read it's the solution to their problem and checked out the command usage in manual, but haven't read the fine print and don't realize it serves a completely different function than what they'd expect given how similar it is to e.g. Python's exec()? Happens all the time when learning new things.
That's its particular thing in the 'do one thing and do it well' part of the Unix Philosophy...
I'm not saying it's breaking the "do one thing" philosophy. I'm saying the one thing it does is itself a WTF. I guess it makes more sense if you're deep into Unix and use the exec() family of functions in C library on regular basis, but most Linux users don't.
-
I'm saying the one thing it does is itself a WTF.
It does what it is documented to do. It has done it since forever (well, pretty much since there was a unix shell at all). It's useful since it lets you transfer control to another program without needing to allocate system resources, which remains useful now and was vital when systems had less memory and CPU power.
Should it have been called
exec
? PerhapsreplaceWith
would have been better, but Naming Things is well known to be one of the two hardest things in computer science (along with cache invalidation, off-by-one-errors and scope creep).
-
-
I'm saying the one thing it does is itself a WTF.
It does what it is documented to do. It has done it since forever (well, pretty much since there was a unix shell at all). It's useful since it lets you transfer control to another program without needing to allocate system resources, which remains useful now and was vital when systems had less memory and CPU power.
I'd agree if you were talking about C API function. But in shell, I'm not convinced any of this applies.
-
But doesn't the shebang line mean the whole script is always executed by Perl and not by the shell in the first place?!
Only if the shebang line is read correctly. If it is not, the kernel will end up using /bin/sh as interpreter as a fallback.
-
But doesn't the shebang line mean the whole script is always executed by Perl and not by the shell in the first place?!
Only if the shebang line is read correctly. If it is not, the kernel will end up using /bin/sh as interpreter as a fallback.
Oh, interesting. I assumed it would read the perl part correctly and truncate the arguments at some point.
TIL.
-
I'm saying the one thing it does is itself a WTF.
It does what it is documented to do. It has done it since forever (well, pretty much since there was a unix shell at all). It's useful since it lets you transfer control to another program without needing to allocate system resources, which remains useful now and was vital when systems had less memory and CPU power.
Should it have been called
exec
? PerhapsreplaceWith
would have been better, but Naming Things is well known to be one of the two hardest things in computer science (along with cache invalidation, off-by-one-errors and scope creep).Arguably the windows way (or
posix_spawn
) is usually what you actually want. And there is significant benefit to having it as a system call; even with linux using copy-on-write pages there is significant performance cost to pausing all threads of the invoking program and copying the page table when forking a large process.
-
the kernel will end up using /bin/sh
The who now? Seriously? What's the kernel doing, executing shell scripts? Is that how things work in Linux-land?