May 26 16:40
One might argue that the whole "[needs to] eat[s]" is unnecessary, since for creatures that do not require food, the "required food for a day" is none at all.
 
Mar 25 17:03
@Job_September_2020, and yet, if you mix the two up, or seemingly combine them into one, it creates the appearance that you don't know the difference between the two. (I'm not saying you don't know, just that the original phrasing mixed them up.)
 
Jan 17 11:25
That argument about absolute growth of total GDP doesn't really fit in the paragraph about GDP per capita. It reads like arguing that it doesn't matter that the per capita GDP is lower than most states, since the higher total growth will fix it soon anyway. But that's mixing two different things, and even if you insist that per capita GDP isn't relevant, using absolute total growth to argue about it is just moving the goalposts on the fly.
 
Dec 19, 2024 14:07
@jesse_b yeah, I wonder if "command passes" can be read as "command returns". Or whatever, idk.
Dec 19, 2024 13:54
@AlbanBrowaeys well, if "when a command passes" means "when a command returns successfully", then isn't it true that when it happens any following || cmd are skipped and the next && cmd runs? (and vice versa a falsy exit status) And after that of course again based on what that next command returned. E.g. in true || x || y && false && z the x and y are skipped, and the && false runs?
 

 /dev/chat

General discussion for unix.stackexchange.com. If you have a q...
Dec 19, 2024 14:03
:D
Dec 19, 2024 13:55
too bad it doesn't actually move
Dec 19, 2024 12:50
@jesse_b Hmm, are there really differences between ctime handling in different Linux filesystems (or between Linux and BSDs or such)? I mean, other than ones like FAT which I suppose doesn't store it separately at all. Just asking because this is the first I've ever heard of this (ctime being rather generally less-than-useful is a different issue...)
Oct 30, 2024 12:40
I... just saw a KB article from $vendor explaining how thing X doesn't always work properly because they (try to) parse the output of ls -l using cut -d' ', and it breaks if^H^H when the timestamp has extra spaces. I know people post slightly questionable ls-parsing on the site every once in a while, but seeing it live is different. And this isn't even some newlines-in-filenames corner-case. I need a drink.
Oct 9, 2024 06:56
Honestly, it seems hard to argue against elevating only the parts that need it, minimal exposure and all that. Plus sudoing the whole script exposes the shell too, not just all the programs the shell calls. On the other hand interactive use where your shell is underprivileged for the task and you need to sudo everything is a pain. Not because of the typing but because tab completion of filenames doesn't work
Oct 9, 2024 06:54
@jesse_b There's less typing if you run the whole script under sudo ;)
Aug 8, 2024 11:39
Ok, I'm not exactly sure what sort of a feed Andreas meant, I thought it was about something that would appear in chat.
Aug 8, 2024 11:24
though the comparison to grocery stores fails since they don't usually provide platforms for generic communication, like chats here are
Aug 8, 2024 11:20
@jesse_b insofar as SE's goal is to collect information and make it available to the public, I'm not sure Codidact is a competitor, but just another party working towards the same goal. And I had the impression that that's at least what SE says their goal is...
Jul 30, 2024 15:11
@StephenKitt right, I can't read, sorry
Jul 29, 2024 19:00
@StephenKitt depends on shopt xpg_echo (and how Bash is compiled; the /bin/sh on macs has that behaviour even without the shopt)
Jul 27, 2024 09:04
https://pubs.opengroup.org/onlinepubs/9799919799/
"The Open Group Base Specifications Issue 8
IEEE Std 1003.1™-2024 Edition"
"Spec_version: Fri Jul 26 10:09:59 UTC 2024"
time to update bookmarks?
May 23, 2024 08:09
@muru yeah, the list numbers were missing: i.sstatic.net/QrmDN1nZ.png That was on Safari, and it does look better on Firefox. Maybe I should have guessed it was a browser issue. (Especially since it did seem odd you'd leave it broken like that.)
May 9, 2024 07:57
If the privileged process tries to check it first, the attacker can still race to change an allowed file to a symlink, and they might get to try again and again until it works. (Sorry if I'm repeating what you already know, I just noticed the linked article didn't seem to explain it too much.)
May 9, 2024 07:56
@terdon (re. /proc/sys/fs/protected_*) well the kernel does all the other access controls too, and doing that in the kernel makes it immediately available to all tools. More to the point, the kernel is the only place where those checks can be done without races. The vulnerability being thwarted there is something like putting a symlink in /tmp, and then tricking a privileged process into following it (modifying /etc/passwd or whatever).
Apr 2, 2024 17:18
switching to Perl completely so they can call split() and glob() explicitly when they want to comes to mind...
Apr 2, 2024 17:13
now my head hurts and I was the one who wrote that answer, asdf
Apr 2, 2024 17:13
Insofar as anything to do with IFS and word splitting makes sense
Apr 2, 2024 17:11
...so muru's solution of just not putting the glob in a variable in the first place is better, too
Apr 2, 2024 17:09
Doing while one; do two; IFS=; three; done; four would make it look like it's blanked only for three, while it really would be blanked for everything but the first repeats of one and two, so in that sense it makes it IMO clearer to set it before the loop.
Apr 2, 2024 17:05
@terdon The unquoted expansion of ${fullmatchStr} needs to have IFS set to the empty string beforehand to prevent word splitting there. But then read needs to have it set to something that contains the space to get the two separate fields from the file. Conflicting demands. And then read would inherit the global IFS, if it wasn't explicitly given another value...
Apr 2, 2024 16:48
no, that's exactly what doesn't work. :) (IFS= ; rename ...) might, but it's a useless subshell
Apr 2, 2024 16:44
Putting the IFS= inside the loop might make it seem like it only applies within the loop body. It'll probably look awkward or confusing either way, sigh.
Apr 2, 2024 16:37
yes, exactly, the IFS=" " read was in the original post. It does look odd the way I wrote it though..
Mar 22, 2024 17:48
Thanks, Jeff.
 
Oct 22, 2024 11:05
On the other hand, what would explain this, would be putting the awk code in double-quotes, i.e. awk -F"[][]" "/Left:/ { print $2 }". That would cause the shell to expand $2 to the empty string (since vol-get didn't get any arguments), ending up in awk seeing just { print }, which prints the whole input line. Of course, that's not what the command -V vol-get output in that last edit shows, but we also don't see the function being run in the same session.
Oct 22, 2024 11:05
Changing the double quotes to single quotes in "[][]" would not matter here, as long as the shell is anything remotely common. In POSIX sh and variants, the square brackets aren't special in double quotes (and I don't see a difference with tcsh or fish either). Pretty much anything wrong with the -F to awk should cause $2 to be empty or some other substring of the input line; it's a bit hard to see how any reasonably possible value of FS could make $2 equal the whole input line.
Oct 22, 2024 11:05
what's 'pipe-to-awk'? You only mention it in the question title?
 
Jul 15, 2024 08:57
right, and Arch should have KillUserProcesses disabled. Hmm.
Jul 15, 2024 08:34
the various keepalive options of ssh(d) mostly just help detect a broken network connection sooner than TCP itself would detect it.
Jul 15, 2024 08:33
but if you can run e.g. screen there and it stays running after you log out, then it's not about that. (because the same features would kill it, too)
Jul 15, 2024 08:32
@terdon, I don't know what you're running on the laptop, but at least systemd has some features to clean up stray processes after a login session ends (KillUserProcesses and "lingering"), see e.g. unix.stackexchange.com/q/659150/170373 and wiki.archlinux.org/title/Systemd/…
 
Jul 14, 2024 12:27
But I don't think the quote in the man page says that. Because, while the connection between the program and the SSH process on the remote could be another TCP connection, even within the same host, that would seem an odd choice. A pipe (or a unix socket) would be more common. And indeed running e.g. ssh foo 'ls -l /proc/self/fd' shows stdin/out/err connected to pipes, at least on that particular host and OpenSSH version anyway. (And if it was an interactive session, the program started on the remote would be connected to pseudo-terminal, definitely not a TCP connection.)
Jul 14, 2024 12:27
@user10489, between the two hosts? TCP, usually, yes. And yes, the client side process likely stops when the connection closes. But the program (shell, maybe) started on the remote can't be directly connected to the TCP connection between the two hosts, since most programs don't talk the SSH protocol. It has to be connected to an SSH process on the remote side, and the connection between those two is the one you close with the redirections there. Which shows that the remote-side SSH tracks those fds. That's fine, and not that surprising.
Jul 14, 2024 12:27
@user10489, Are you sure? Given that the stdin/out/err of the remote process need to be connected to the ssh daemon process on the same host, I would expect it's highly unlikely they'd be TCP connections. Pipes or Unix domain sockets would do for that, probably much more easily. Especially with the parallel to X11, it would seem to me that sentence refers to TCP-forwarding over the SSH connection.
Jul 14, 2024 12:27
The man page doesn't say anything about waiting for the fds to close, though, so one might say it's a bit in accurate there. It does make sense that it'd wait for both the immediate child process to exit, and for the fds to close.
 
Mar 18, 2024 22:58
@Nickotine, I did respond, five comments up. Restating the same thing I said before. And yet here you are, saying it's everyone else who can't read. An endless source of irony and amusement... Anyway, you'll have to excuse us if we mix up what lies you're referring to. You throw so many of those accusations around that it's rather hard to keep track.
Mar 18, 2024 22:58
@Nickotine, You're using word splitting in the script, and word splitting works using the value of IFS. So, no, we can't really ignore that you changed its value, if we want to figure out what actually happens. I do maintain that the change you made in the answer, moving the export out of the function is cosmetic. Like aviro says, you could have shown an actual situation demonstrating how it changes things, or explained why you think it does. But nah, if you want to resort to that name-calling then sure, yes, why don't you, I'm sure it works well in other contexts, too?
Mar 18, 2024 22:58
Well, actually I am kinda interested in what the actual scenario is. Mostly because I can't tell from the information here what the relevant change would have been, and why. Like I said, I tried the three snippets you posted and got the same result for each. So, yeah, please do post the actual scenario.
Mar 18, 2024 22:58
I never claimed you used the words "cosmetic change". I used them. Because moving that export into or out of a function is cosmetic enough, at least in the code you show. But then again, we seem to be talking about two different pieces of code, you have one that you refuse to show, and I only see the one that doesn't reflect your real situation. Note that the closure text says "or", and, that they're canned, btw, so no, I can't edit them. Not that it should be just my call anyway, when some others seem to also voted to close. (Including one called Nickotine, surprisingly enough.)
Mar 18, 2024 22:58
I don't know what the supposed typo is. But it does seem to me this is a problem that can't be reproduced (as stated above, I tried), and that you claim it went away through a cosmetic change. You also stated that the problem described above isn't even the one you had, and that you're not interested in telling what the actual issue was, so yes, it does also seem that nothing here is likely to help future readers.
Mar 18, 2024 22:58
Well, you're showing us a script that relies on word splitting to do what you want. That means IFS matters, it can't be ignored. If your actual script is something other than you showed, then perhaps you can see how that might affect the responses you get? Assuming people know what you mean when it appears you've obfuscated it on purpose is somewhat irrational...
Mar 18, 2024 22:58
But, to be honest, I don't really expect you to switch to actually showing what it is you did, how you run those scripts, or what shell you used. Let alone what your actual end goal was, or why you think parallel would need to see IFS at all.
Mar 18, 2024 22:58
Now, if you think of comments like that as "coming after you", and in general take the attitude you seem to be taking in the comments here, then I do wonder why you bothered to ask a question here in the first place? Surely you must have known that to get any useful answers, you need to actually explain to people what result you're aiming is? Also, I might suggest considering if calling people names really helps if your goal is to learn something about how all this stuff works, or if only works to alienate the very people you're trying to ask to help you?
Mar 18, 2024 22:58
I didn't do any witchcraft, I did exactly what I said I did. That is, I ran the scripts you showed and the command you gave. And the results didn't make it all clear what the issue you were asking about was, or really even what the desired result was.