'dd' command cannot support calculation for its parameters

$ dd if=/dev/zero of=./4Ktest100M bs=4KB count=25000*9
dd: invalid number `25000*9'
asked Dec 19, 2015 by harryxiyou (5,830 points)

1 Answer

 
Best answer

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

answered Dec 19, 2015 by harryxiyou (5,830 points)

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)
commented Dec 20, 2015 by Eric Z Ma (44,280 points)

I think it makes sense. Thank you.

commented Dec 21, 2015 by harryxiyou (5,830 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...