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 回答1: In PowerShell, you would do it this way: "AAAAA{0}{1}{2}{3}" -f 0x86,0x08,0x04,0xed | ./program 回答2: I recently came up with the same question myself and decided