Looping in Fish Shell

1 min read 51 words

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