Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fish shell for loop oneliner

Tags:

shell

fish

I'm not sure how to do a for loop using fish shell. I keep having to drop out of fish to run it in bash.

take this for example:

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

I get:

fish: $(...) is not supported. In fish, please use '(cat)'.
for i in $(cat subdomains); do curl $i | html2text >> websites
         ^
like image 579
Row Avatar asked Sep 02 '26 01:09

Row


1 Answers

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

is the answer

like image 85
Row Avatar answered Sep 05 '26 17:09

Row