Quantcast
Channel: How to use globbing for loop in bash -c command? - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

How to use globbing for loop in bash -c command?

$
0
0

I'm trying to run a for loop inside of bash -c so I can time it. This code writes 23 every time. How can I make it iterate through the numbers?

time bash -c "for i in {0..23}; do echo $i & done"

This code works, but I need to time the whole operation:

for i in {0..23}; do echo $i & done

The echo command is just for simplicity. I am really trying to run dd, that's why I background the process with &


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images