‘dd’ command cannot support calculation for its parameters

$ dd if=/dev/zero of=./4Ktest100M bs=4KB count=25000*9
dd: invalid number `25000*9'

I think ‘dd’ should support calculation for its parameters like ‘bs’, ‘count’ and so on.

Answered by harryxiyou.

You can get the effect by using some other tools/commands, like

dd if=/dev/zero of=./4Ktest100M bs=4KB count=$((25000*9))

or

dd if=/dev/zero of=./4Ktest100M bs=4KB count=$(bc <<< 25000*9)

I think it makes sense. Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *