1. bash / Говнокод #18532

    −704

    1. 1
    test "$(whoami)" != 'root' && (echo you are using a non-privileged account; exit 1)

    Real Programmers
    Most programmers will prefer to use the test built-in command, which is equivalent to using square brackets for comparison, like this

    http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html#sect_07_01_02_03

    Вот такие они, real programmers.
    Подсказка: Круглые скобки в шелле запускают саб-шелл

    Запостил: Elvenfighter, 26 Июля 2015

    Комментарии (74) RSS

    Добавить комментарий