История о сложном решении и допущении его неудачи

Используйте опцию -f -для awk, чтобы взять скрипт из стандартного ввода и здесь -документ:

awk -F: -v "ID=$ID_minimum" -f - <<'EOT' /etc/passwd
$3>=1000 && $1!="nfsnobody" {
    print "xfs_quota -x -c 'limit bsoft=5g bhard=6g "$1"' /home "
}
EOT
-1
01.12.2021, 22:01
1 ответ

Наконец-то я нашел его, оригинальная история находится в "The Rise of Worse is Better" Ричарда П. Габриэля и я также читал об этом в The Art of Unix Programming . Таким образом, история:

Two famous people, one from MIT and another from Berkeley (but working on Unix) once met to discuss operating system issues. The person from MIT was interested in how Unix solved the PC loser-ing problem, that it's basically about how system calls that do long operations handle interrupts they cannot hold or mask. The MIT guy did not see any code that handled this case and asked the New Jersey guy how the problem was handled. The New Jersey guy said that the Unix folks were aware of the problem, but the solution was for the system routine to always finish, but sometimes an error code would be returned that signaled that the system routine had failed to complete its action. A correct user program, then, had to check the error code to determine whether to simply try the system routine again. The MIT guy did not like this solution because it was not the “right” thing. The New Jersey guy said that the Unix solution was right because the design philosophy of Unix was simplicity and that the right thing was too complex. Besides, programmers could easily insert this extra test and loop. The MIT guy pointed out that the implementation was simple but the interface to the functionality was complex. The New Jersey guy said that the right tradeoff has been selected in Unix -- namely, implementation simplicity was more important than interface simplicity.

1
03.12.2021, 18:11

Теги

Похожие вопросы