Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash 'printf' equivalent for command prompt?

I'm looking to pipe some String input to a small C program in Windows's command prompt. In bash I could use

$ printf "AAAAA\x86\x08\x04\xed" | ./program

Essentially, I need something to escape those hexadecimal numbers in command prompt.

Is there an equivalent or similar command for printf in command prompt/powershell?

Thanks

like image 876
Calum Murray Avatar asked Mar 13 '11 14:03

Calum Murray


1 Answers

In PowerShell, you would do it this way:

"AAAAA{0}{1}{2}{3}" -f 0x86,0x08,0x04,0xed | ./program
like image 175
Keith Hill Avatar answered Nov 09 '22 03:11

Keith Hill