4
如何在Bash中将命令的输出作为命令导入?
系统 Linux hosek 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux 问题 我需要在bash脚本中以命令的形式获取输出以存储变量。 例 sed -n '/# Main configuration./,/# Websites./p' webcheck-$category.cfg | sed '1,1d' | sed '$ d' 此命令返回以下行: email_sender='some@email.com' email_recipients='another@email.com' 如何在脚本中将这些输出/行作为命令读取/运行?是否将此输出存储到文件中,然后source仅通过命令读取它? 我| source在命令末尾尝试过,但是它仅从文件中读取。 我echo在一开始就尝试过,但是没有效果。 谢谢。