3 ms·
I use it often with udev rules. You can execute a command upon a udev event, but only 1. If I want to run command1 && command2 Then I can't do it, udev wil
by not_your_vase 3y ago
I use it often with udev rules. You can execute a command upon a udev event, but only 1.
If I want to run
command1 && command2
Then I can't do it, udev will usually just silently do something that I don't want, either execute only the first command, or nothing (don't remember from the top of my head. Maybe it passes the second command as an argument to the first one?). However
bash -c "command1 && command2"
is one command from udev's point of view, and will do exactly what I want (and the bash process will do the actual work).
Beside that, maybe your current shell is different from bash (or whatever shell you want to use), but still you want to execute some bashism. This would be another case when it can be useful.
- shivajikobardan 3y agowhat is udev?