Я знаю о людях, использующих уведомления о нажатии с Рычанием/Рысканьем на iPhone.
Вот пример для демонстрации поведения.
$ # set testvar to be a value
$ testvar=asdf
$ # demonstrate that it is set in the current shell
$ echo $testvar
$ # create a bash subprocess and examine the environment.
$ bash -c "export | grep 'testvar'"
$ bash -c 'echo $testvar'
$ # export testvar and set it to the a value of foo
$ export testvar=foo
$ # create a bash subprocess and examine the environment.
$ bash -c "export | grep 'testvar'"
declare -x testvar="foo"
$ bash -c 'echo $testvar'
foo
$ # mark testvar to not be exported
$ export -n testvar
$ bash -c "export | grep 'testvar'"
$ bash -c 'echo $testvar'
Вы заметите это без export
новый удар обрабатывает Вас созданный, не смог видеть testvar
. Когда testvar
экспортировался, новый процесс смог видеть testvar
.
Экспортируйте переменную оболочки как переменную среды.
Посмотрите этот Bash учебным руководством в качестве примера от IBM. Это даже включает пример использования export
.