Hello! On Tue, 21 Nov 2017 at 00:53:33 (+0200), Irina Liakh wrote:
> Всплыло непонятное поведение команды test (builtins из sh и bash и /bin/test), > подскажите, какой в этом смысл? Я бы перефразировал: всплыло некорректное использование команды test. > Из man test: > string True if string is not the null string. > -n string True if the length of string is nonzero. > -z string True if the length of string is zero. > Но -n, вопреки ожиданиям, ведёт себя не аналогично: > $ if [ -n ]; then echo yes; else echo no; fi > yes > $ if [ -n "" ]; then echo yes; else echo no; fi > no > #какжетак? Первая же ссылка в #тугугл: https://stackoverflow.com/questions/5450391/how-comes-test-n-returns-true-in-bash -- George L. Yermulnik [YZ-RIPE] _______________________________________________ freebsd mailing list [email protected] http://mailman.uafug.org.ua/mailman/listinfo/freebsd
