bash - Bash 行导致某种与 ssh 的递归
问题描述
我在 bash 启动脚本中有以下行:
declare -fx $(bash -c "source ~/.local/bash.d/functions/10-git.bash &> /dev/null; compgen -A function")
在本地启动 bash 时我没有收到任何错误,但是当我从另一台机器 ssh 时,它会导致一堆错误:
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.
我猜它会导致某种递归,但我不清楚为什么只有当我 ssh 进入机器时才会发生这种情况。我能做些什么来防止错误吗?
解决方案
推荐阅读
- math - 将温度转换为 RGB 值
- python - 无法从 Anaconda 2019.03 启动 jupyter
- tensorflow - 动态输出形状不正确/与静态不同
- python - 带有 Python 引擎的 Nifi ExecuteScript 处理器未记录信息
- asp.net - SPWeb.EnsureUser 当用户不再存在于 AD 中时获取 SPUser 对象
- python - python unittest:在单元测试中断言方法调用的顺序
- java - 如何检查 RXJava 是否完成或从队列中清空
- javascript - 兑换
至 使用带有回调函数的 Hooks - reactjs - 在 react-native 中使用 String 对象
- node.js - 使用 api (nodejs) 更新谷歌表格时出错