Timeline for Why wait in this script is not executed after all subshells?
Current License: CC BY-SA 4.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 28, 2022 at 12:46 | comment | added | ilkkachu | Also re. read line, if you do that, you probably want IFS= read -r line instead, see Understanding "IFS= read -r line". (Still only matters if your filenames are naughty.) | |
| Jan 28, 2022 at 10:04 | comment | added | Saeed Neamati | Marcus, when we become dynamic, there is no "inclusive" approach unless you configure stuff. Thus we search everywhere, that makes sense. A gir repo might be cloned inside the root, or in home, or in any other place. If I give you my laptop, how do you know where are my git clones? | |
| Jan 28, 2022 at 0:57 | history | became hot network question | |||
| Jan 27, 2022 at 18:27 | comment | added | ilkkachu | As they's answer says, this is similar to Why is my variable local in one 'while read' loop, but not in another seemingly similar loop?. The answers there have some other workarounds. | |
| Jan 27, 2022 at 17:46 | vote | accept | Saeed Neamati | ||
| Jan 27, 2022 at 17:46 | comment | added | Marcus Müller | @SaeedNeamati that's the opposite I've wanted to achieve. instead of excluding directories, you should search only these that you care for (instead of /, which really makes no sense). | |
| Jan 27, 2022 at 17:43 | answer | added | Kusalananda♦ | timeline score: 17 | |
| Jan 27, 2022 at 17:41 | comment | added | Saeed Neamati | @MarcusMüller, thanks for notifying me about those directories. I will exclude them. | |
| Jan 27, 2022 at 17:41 | comment | added | Kusalananda♦ | @MarcusMüller The issue is that the background tasks are associated with the subshell at the end of the pipe. Puttting tho wait in the same subshell helps. | |
| Jan 27, 2022 at 17:32 | comment | added | Marcus Müller | It's unlikely, but still possible, that one of your paths contains a newline at some point in time. And that will break your read. Using find … | is practically newer a good way of dealing with these things. Also, it feels very awkward that instead of specifying the directories you actually want to search in you exclude some. Congratulations for searching /sys/ and /dev/ and /var/run/ … for git repos! | |
| Jan 27, 2022 at 17:28 | history | edited | Marcus Müller | CC BY-SA 4.0 | added 5 characters in body |
| Jan 27, 2022 at 16:53 | history | asked | Saeed Neamati | CC BY-SA 4.0 |