[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Null в качестве разделителя в скрипте



On 2016-12-01, Artem Chuprina wrote:

>  >> Но в принципе, уже достаточно полистать историю правок к скриптам
>  >> пакетов в дебиане за период, когда шла волна борьбы за работу скриптов в
>  >> dash. То и дело всплывала вычистка башизмов из скриптов, начинающихся на
>  >> #!/bin/sh.
>
>  > Простите, а это здесь каким боком?
>
> Элементарно, Ватсон. Понимание башем башизма в режиме совместимости с
> /bin/sh не является POSIX-совместимым. Потому что не позволяет заменить
> /bin/sh на другой POSIX-совместимый для выполнения этого скрипта.

Может те случаи подпадали под undefined behavior?

В результате скрипты переписали, исключив элемент неоднозначности, допустимый
стандартом?

bash(1):

  Bash is intended to be a conformant implementation of the Shell and Utilities
  portion of the IEEE POSIX specification (IEEE Standard 1003.1).  Bash can be
  configured to be POSIX-conformant by default.

  If bash is invoked with the name sh, it tries to mimic the startup behavior
  of historical versions of sh as closely as possible, while conforming to the
  POSIX standard as well.

Все что не так - это ошибка и будет исправлено в новой версии.

В ``info bash`` описаны 2 несоответствия POSIX:

    There is other POSIX behavior that Bash does not implement by default
  even when in POSIX mode.  Specifically:

  1. The 'fc' builtin checks '$EDITOR' as a program to edit history
     entries if 'FCEDIT' is unset, rather than defaulting directly to
     'ed'.  'fc' uses 'ed' if 'EDITOR' is unset.

  2. As noted above, Bash requires the 'xpg_echo' option to be enabled
     for the 'echo' builtin to be fully conformant.

-- 
http://defun.work/


Reply to: