Timeline for How can I use bash's if test and find commands together?
Current License: CC BY-SA 3.0
16 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 28, 2021 at 10:40 | comment | added | Freedo | Easier to check systemd status, or if the process is running | |
| Dec 28, 2021 at 10:29 | comment | added | Noam Manos | -exec is good for quick response, but for wider conditions if find ... | grep . is better: unix.stackexchange.com/a/684153/43233 | |
| Dec 28, 2021 at 10:14 | answer | added | Noam Manos | timeline score: 0 | |
| Dec 18, 2020 at 16:06 | answer | added | Michael Martinez | timeline score: 0 | |
| Dec 11, 2020 at 11:07 | review | Suggested edits | |||
| Dec 11, 2020 at 14:52 | |||||
| Feb 1, 2018 at 18:16 | answer | added | Jules | timeline score: 1 | |
| Feb 1, 2018 at 18:12 | comment | added | Jules | @Wildcard - unfortunately that doesn't solve the general case: it doesn't work if there is more than one match and the action needs to only run once, and it doesn't work if you need an action to run when there are no matches. The former can be solved by using ... -exec command ';' -quit, but I don't believe there is any solution for the latter other than parsing the result. Also, in either case, the primary problem with parsing the result of find (i.e. inability to distinguish delimiters from characters in filenames) doesn't apply, as you don't need to find delimiters in these cases. | |
| Oct 18, 2017 at 23:59 | comment | added | Wildcard | The real answer to the general case is to use find ... -exec. Also see the example commands under Why is looping over find's output bad practice? | |
| Feb 19, 2013 at 3:26 | answer | added | Zombo | timeline score: 1 | |
| Sep 3, 2012 at 16:02 | vote | accept | cwd | ||
| Aug 31, 2012 at 1:36 | answer | added | Gilles 'SO- stop being evil' | timeline score: 2 | |
| Aug 29, 2012 at 9:00 | history | tweeted | twitter.com/#!/StackUnix/status/240735727229497344 | ||
| Aug 28, 2012 at 23:50 | history | edited | Gilles 'SO- stop being evil' | edited tags | |
| Aug 28, 2012 at 19:49 | answer | added | mrb | timeline score: 41 | |
| Aug 28, 2012 at 19:46 | answer | added | angus | timeline score: 14 | |
| Aug 28, 2012 at 19:06 | history | asked | cwd | CC BY-SA 3.0 |