Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #247291
| From | Greg Wooledge <greg@wooledge.org> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: disable IPv6 debian |
| Date | 2022-04-16 15:10 +0200 |
| Message-ID | <EcQlA-98iF-3@gated-at.bofh.it> (permalink) |
| References | (5 earlier) <EcEu5-90Zc-1@gated-at.bofh.it> <EcENr-915z-3@gated-at.bofh.it> <EcFJv-91D1-3@gated-at.bofh.it> <EcGPf-92lU-5@gated-at.bofh.it> <EcPpv-97KJ-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sat, Apr 16, 2022 at 08:07:09AM -0400, The Wanderer wrote: > ...Huh. That's so unintuitive that it hadn't even occurred to me to test > it before posting, but I just did test it (with 'ps', not 'foobar', > because there's a reason why 'ps' would be special for this purpose), > and you're correct. > > I *think* it makes sense on examination? In that the fact that the first > grep command occurs in the ps output in the first place must mean that > its process is in some sense started before the ps command is run, even > though the ps command comes earlier in the pipeline, so the same must > logically hold true for the *second* grep command as well. All of the commands in a pipeline are executed simultaneously, in parallel. Except of course nothing is truly simultaneous. The shell will attempt to start them all at roughly the same time, but individual timing issues across three child processes cause what we call a "race condition". Sometimes, one of them runs a bit too fast, or a bit too slow, and you get weird results. For this pipeline, ps -ef | grep foobar | grep -v grep the race condition is that the ps command could execute so quickly that the 'grep foobar' process hasn't even started yet. And then, you would *not* see 'grep foobar' in the output of ps, and so the final 'grep -v grep' wouldn't match any lines. In practice, you might not ever see this happen, at least not in a small number of trials. But if you do this thousands of times, on systems with varying loads, you might. And of course, tomas raised the excellent point that this is not the best way to show a process when you already know its PID. ps -ef | grep "$mypid" is silly. You can simply do ps -fp "$mypid" instead. You even get to see the headers, which are lost in the silly variant.
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-15 13:50 +0200
Re: disable IPv6 debian 황병희 <soyeomul@doraji.xyz> - 2022-04-15 14:00 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-15 14:30 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-15 17:00 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-15 18:00 +0200
Re: disable IPv6 debian Tim Woodall <debianuser@woodall.me.uk> - 2022-04-15 18:10 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 02:10 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-16 02:20 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 02:30 +0200
Re: disable IPv6 debian Charles Curley <charlescurley@charlescurley.com> - 2022-04-16 02:40 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-16 02:50 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 03:10 +0200
Re: disable IPv6 debian The Wanderer <wanderer@fastmail.fm> - 2022-04-16 03:50 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 04:10 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-16 05:00 +0200
Re: disable IPv6 debian The Wanderer <wanderer@fastmail.fm> - 2022-04-16 14:10 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-16 15:10 +0200
Re: disable IPv6 debian David Wright <deblis@lionunicorn.co.uk> - 2022-04-16 18:10 +0200
Re: disable IPv6 debian <tomas@tuxteam.de> - 2022-04-16 08:20 +0200
Re: disable IPv6 debian Tim Woodall <debianuser@woodall.me.uk> - 2022-04-16 08:40 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 10:30 +0200
Re: disable IPv6 debian David <bouncingcats@gmail.com> - 2022-04-16 10:50 +0200
Re: disable IPv6 debian Greg Wooledge <greg@wooledge.org> - 2022-04-16 15:00 +0200
Re: disable IPv6 debian Michael Stone <mstone@debian.org> - 2022-04-16 20:00 +0200
Re: disable IPv6 debian <tomas@tuxteam.de> - 2022-04-16 08:20 +0200
Re: disable IPv6 debian Chuck Zmudzinski <brchuckz@netscape.net> - 2022-04-15 19:40 +0200
Re: disable IPv6 debian Andy Smith <andy@strugglers.net> - 2022-04-16 01:00 +0200
Re: disable IPv6 debian didar <nosferatu@purlo.in> - 2022-04-16 07:10 +0200
Re: disable IPv6 debian Andy Smith <andy@strugglers.net> - 2022-04-16 11:50 +0200
Re: disable IPv6 debian Reco <recoverym4n@enotuniq.net> - 2022-04-15 14:30 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-15 14:40 +0200
Re: disable IPv6 debian Erwan David <erwan@rail.eu.org> - 2022-04-15 16:00 +0200
Re: disable IPv6 debian Jeremy Ardley <jeremy@ardley.org> - 2022-04-15 16:20 +0200
Re: disable IPv6 debian Reco <recoverym4n@enotuniq.net> - 2022-04-15 16:20 +0200
Re: disable IPv6 debian wilson <info@bigcount.xyz> - 2022-04-16 02:20 +0200
Re: disable IPv6 debian Ash Joubert <ash@transient.nz> - 2022-04-16 02:20 +0200
csiph-web