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

Re: Cron и скрипты



Stanislav Maslovski пишет:
На самом деле, то, что тебе нужно, делается с помощью
${parameter##word}, независимо от локали. man bash.
Всегда для домашнего stuf использую Shell Substitutions.

В Linux-овском sh большинства дистрибутивов и bash это так, но
читаем http://www.gnu.org/software/autoconf/manual/autoconf.html#Shell-Substitutions


|${#|var|}|
|${|var|%|word|}|
|${|var|%%|word|}|
|${|var|#|word|}|
|${|var|##|word|}|
Posix requires support for these usages, but they do not work with
many traditional shells, e.g., Solaris 10 /bin/sh.

Also, pdksh 5.2.14 mishandles some word forms. For example if ‘$1’
is ‘a/b’ and ‘$2’ is ‘a’, then ‘${1#$2}’ should yield ‘/b’, but with
pdksh it yields the empty string.

|||
|


--
С уважением, Александр Гавенко.


Reply to: