Reputation: 110153
Without doing a for
loop in bash is there a way to execute a command N times? For example:
$ pulldown 123 && pulldown 123 && # ...etc [100 times]
Upvotes: 1
Views: 5412
Reputation: 332816
You can use a for loop and simply ignore the argument:
for i in $(seq 1 100); do pulldown 123; done
If you absolutely can't use a for loop for some reason, you could use xargs -n 1
and ignore the argument, with something like the following; the -n 1
indicates to run the command once per line of input, and the -I XXX
means replace all occurrences of XXX in the command with the current input line (but since we don't use that in the command, it is ignored):
seq 1 100 | xargs -n 1 -I XXX pulldown 123
Upvotes: 7