shell - 循环oneliner的 fish shell

标签 shell fish

我不确定如何使用 fish shell 进行 for 循环。我一直不得不退出 fish 以在 bash 中运行它。

以这个为例:

for i in $(cat subdomains); do curl $i | html2text >> websites

我得到:

fish: $(...) is not supported. In fish, please use '(cat)'.
for i in $(cat subdomains); do curl $i | html2text >> websites
         ^

最佳答案

for i in (cat subdomains); curl $i | html2text; end >> websites

就是答案

关于shell - 循环oneliner的 fish shell ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58980459/

相关文章:

linux - 如何让 bash 脚本回答交互式提示(仅无 y/n)?

使用 sed 命令从文本文件中提取字符串

shell - "&&"是否完全等同于 fish shell 中的 "and"?

amazon-web-services - 使用 Fish shell 完成 AWS CLI 命令

intellij-idea - IntelliJ 的嵌入式终端无法正确加载我的 fish shell 配置

bash - Fish shell中运行脚本的目录

使用带有 rbenv 的 fish shell 找不到 bundle 程序

shell - 在 shell 脚本中使用 Puppet 事实 (Facter)

arrays - shell脚本数组长度

shell - 使 Emacs eshell/echo 换行符在常规终端中表现得像