0

I am running a shell script on a Android phone, filling the space up by create some files. Part of it as follows:

while ((i < count)); do
    dd if=/dev/zero bs=$file_size count=1 of=file.$i.bin
    ((i++))
done
sync

However, it prints dd: 0<1 in the shell. I could not find similar questions on the internet.

Any hint?Many thanks in advance.

3
  • 2
    What is the value of $file_size when this happens?
    – Kusalananda
    Commented Feb 26, 2020 at 10:00
  • As an input parameter,which I set 1: file_size_MB=$1 file_size=$((file_size_MB*1024*1024))
    – Mengge
    Commented Feb 26, 2020 at 10:05
  • 1
    So what is $1 then? You know, like 0 multiplied by anything is still 0.
    – user313992
    Commented Feb 26, 2020 at 10:06

1 Answer 1

3

[just to create a search result on the internet]

dd: 0<1 means that you give a value of 0 to a dd argument which expects something greater than or equal to 1. In your case, you have called dd with bs=0 which is not acceptable.

Most dd implementations have a friendlier error message for it, just as android's/toybox's dd used to in the past.

That particular error message is produced by the atolx_range() as called by the toybox implementation of of dd.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .