Bash : echo binary output -


for script must create file , add line (only numeric) this. should in binary mode, havent found solution.

my commands:

size=200 touch quota echo $size >> quota 

how can in binary mode?

perhaps need use -n option?

echo -n "$size" >> quota 

or maybe need binary representation limited 8 bits or 255.

echo -ne "$(printf '\\x%x' 200)" >> quota 

also make sure need use >> , not > >> appends data existing files, not overwrite it.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -