|
|
|
|
|
by c0l0
3845 days ago
|
|
A guy publishing a guide for "defensive bash programming", who, in the process, provides this listing as an example for anything, is not fit for publishing said guide in the first place: main() {
local files=$(ls /tmp | grep pid | grep -v daemon)
}
|
|
The text read:
- Second example is much better. Finding files is the problem of temporary_files() and not of main()’s. This code is also testable, by unit testing of temporary_files().
- If you try to test the first example, you will mish mash finding temporary files with main algorithm.