Нет, календарь не что-то, что может быть настроено с локалями.
Существует календарный модуль perl DateTime для французского Революционного Календаря все же.
$ perl -MDateTime::Calendar::FrenchRevolutionary -le 'print DateTime::Calendar::FrenchRevolutionary->now->strftime("%c")'
Sex 06 Bru 0221 6:97:80
export
в zsh сокращение от typeset -gx
, где атрибут g
означает “глобальный” (в противоположность локальному для функции) и атрибут x
означает “экспортируемый” (т.е. в среде). Таким образом:
typeset +x GREP_OPTIONS
Это также работает в ksh и ударе.
Если Вы никогда не экспортируете GREP_OPTIONS
во-первых, Вы не должны не экспортировать его.
Можно также использовать косвенный, портативный путь: сбрасывание переменной не экспортирует его. В ksh/bash/zsh это не работает, если переменная только для чтения.
tmp=$GREP_OPTIONS
unset GREP_OPTIONS
GREP_OPTIONS=$tmp
Вы могли использовать анонимную функцию для обеспечения объема для переменной. От man zshall
:
ANONYMOUS FUNCTIONS
If no name is given for a function, it is `anonymous' and is handled
specially. Either form of function definition may be used: a `()' with
no preceding name, or a `function' with an immediately following open
brace. The function is executed immediately at the point of definition
and is not stored for future use. The function name is set to
`(anon)'.
Arguments to the function may be specified as words following the clos‐
ing brace defining the function, hence if there are none no arguments
(other than $0) are set. This is a difference from the way other func‐
tions are parsed: normal function definitions may be followed by cer‐
tain keywords such as `else' or `fi', which will be treated as argu‐
ments to anonymous functions, so that a newline or semicolon is needed
to force keyword interpretation.
Note also that the argument list of any enclosing script or function is
hidden (as would be the case for any other function called at this
point).
Redirections may be applied to the anonymous function in the same man‐
ner as to a current-shell structure enclosed in braces. The main use
of anonymous functions is to provide a scope for local variables. This
is particularly convenient in start-up files as these do not provide
their own local variable scope.
For example,
variable=outside
function {
local variable=inside
print "I am $variable with arguments $*"
} this and that
print "I am $variable"
outputs the following:
I am inside with arguments this and that
I am outside
Note that function definitions with arguments that expand to nothing,
for example `name=; function $name { ... }', are not treated as anony‐
mous functions. Instead, they are treated as normal function defini‐
tions where the definition is silently discarded.
Но кроме этого - если Вы не используете export
в Вашем .zshrc
вообще переменная должна только быть видима на Вашей текущей интерактивной сессии, и она не должна быть экспортирована в подоболочки.
Как terdon объясненный в его комментарии: export -n
в bash
правые дела свойство "экспорта", которое будет удалено из переменной, таким образом с помощью export -n GREP_OPTIONS=--color=always
эквивалентно не использованию экспорта вообще - GREP_OPTIONS=--color=always
.
Другими словами, для получения желаемого поведения просто не используйте export
. Вместо этого в Вашем .zshrc
, Вы должны иметь
GREP_OPTIONS=--color=always
Это сделает переменную доступной для всех (интерактивный, невход в систему) окружает Вас выполненный, так же, как Вы хотите, чтобы это было, но это не будет экспортироваться в дочерние оболочки.
env -u GREP_OPTIONS your-script
с некоторымиenv
реализации (любая оболочка). Или(unset GREP_OPTIONS; exec your-script)
– Stéphane Chazelas 29.01.2014, 00:30export_all
(-a
) опция? Но даже затемtypeset +x GREP_OPTIONS
не экспортировал бы переменную. Если Вы не можете найти что случилось, попробуйте двоичный поиск: создайте резервную копию Вашего.zshrc
, удалите вторую половину, посмотрите, возникает ли проблема все еще, то или добавить третий квартал или сокращают к первому кварталу и повторению. – Gilles 'SO- stop being evil' 05.02.2014, 11:45