Bash строка, вызывающая некоторую рекурсию с помощью ssh - PullRequest
0 голосов
/ 01 февраля 2020

У меня есть следующая строка в загрузочном скрипте bash:

declare -fx $(bash -c "source ~/.local/bash.d/functions/10-git.bash &> /dev/null; compgen -A function")

Я не получаю ошибок при локальном запуске bash, но когда я sh в с другой машины это вызывает кучу ошибок:

Last login: Fri Jan 31 09:25:00 2020
5.0.7(1)-release
/Users/me/.local/bash.d/exports/10-git.bash: cannot make pipe for command substitution: Too many open files
/Users/me/perl5/perlbrew/etc/bashrc: cannot make pipe for command substitution: Too many open files
/Users/me/perl5/perlbrew/etc/bashrc: cannot make pipe for command substitution: Too many open files
/Users/me/perl5/perlbrew/etc/bashrc: cannot make pipe for command substitution: Too many open files
/Users/me/perl5/perlbrew/etc/bashrc: line 19: cannot create temp file for here-document: Too many open files
/Users/me/.bashrc: line 8: read: read error: 0: Bad file descriptor
/Users/me/.bashrc: line 7: sort: command not found
/Users/me/.bashrc: line 7: find: command not found
/Users/me/.local/bash.d/exports/10-git.bash: line 10: declare: cannot use `-f' to make functions
Can't locate warnings/register.pm:   Too many open files at /System/Library/Perl/5.18/vars.pm line 7.
BEGIN failed--compilation aborted at /System/Library/Perl/5.18/vars.pm line 7.
Compilation failed in require at /System/Library/Perl/5.18/darwin-thread-multi-2level/Config.pm line 11.
BEGIN failed--compilation aborted at /System/Library/Perl/5.18/darwin-thread-multi-2level/Config.pm line 11.
Compilation failed in require at /Users/me/perl5/perlbrew/bin/perlbrew line 3.
BEGIN failed--compilation aborted at /Users/me/perl5/perlbrew/bin/perlbrew line 3.

Я предполагаю, что это вызывает какую-то рекурсию, но мне неясно, почему это происходит только тогда, когда я sh в машину. Что я могу сделать, чтобы предотвратить ошибки?

...