Looping in Fish Shell

fish · shell · tips|2022-04-19 · 1 min read

Looping Forever

Do something again and again, sleeping for 30 seconds in between until you break the process.

while true;
  echo "Hello Again";
  sleep 30;
end

Looping a specified number of times

Loop for 10 times.

for i in (seq 1 10);
  echo "Loop number $i";
end