Issue
I have the following code:
yes "$(echo -e "\xff")" | head -n 10 > SomeFile.bin
Which writes 10 times 0xFF and 0x0A (newline) to SomeFile.bin. But my objective is to fill the file with FF.
Is there a way to print only consecutive 0xFF values instead? Without adding a newline every time?
Solution
Here is one way:
printf '\xFF%.s' {1..10} >SomeFile.bin
Answered By - oguz ismail Answer Checked By - Mildred Charles (WPSolving Admin)