mardi 19 décembre 2017

Creating random files with random content using bash issue

When creating a random files with random content using the below logic

for x in {1..5}; do
  dd if=/dev/random of=test$x.doc bs=50000 count=4
done

The files are created successfully.

$ls 
test1.doc  test2.doc  test3.doc  test4.doc  test5.doc

But the files are not really "doc" format. The file type shows as

$file --mime-type * 
test1.doc: application/octet-stream
test2.doc: application/octet-stream
test3.doc: application/octet-stream
test4.doc: application/octet-stream
test5.doc: application/octet-stream

These are binary format files. Any suggestion how to make these files as doc format files using the logic mentioned above ?




Aucun commentaire:

Enregistrer un commentaire