Skip to content

Instantly share code, notes, and snippets.

@drbr
Created October 15, 2016 01:53
Show Gist options
  • Save drbr/7f22839f817282064fb7441b13c04e78 to your computer and use it in GitHub Desktop.
Save drbr/7f22839f817282064fb7441b13c04e78 to your computer and use it in GitHub Desktop.
When a command is specified as arguments, runs the command multiple times, printing out the number of the iteration, and waits for the user to press Enter between each run.
#!/bin/zsh
i=0
while { true }; do
echo $((++i)):
$@
read
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment