On 2015-10-27 13:31, Tim Leong wrote: > Is it possible to loop through standard input, similar to this command in > bash? > > for i in `cat`; do echo $i; done > > Then you paste in your STDIN and hit ctrl-d to end STDIN and begin the loop.
I did something similar some time ago with a help of people from the the mailing list: > while read i; set input "$input""$i"\n; end See the following link for wider context: https://github.com/szpak/fish-xclip-enhancer/blob/master/cb.fish#L28 Unfortunately there is one caveat (besides it is quite ugly) - additional "\n" is added at the end which could be unwanted. There is a corresponding issue to make it easier in Fish: https://github.com/fish-shell/fish-shell/issues/1147 Marcin ------------------------------------------------------------------------------ _______________________________________________ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users