mardi 13 mai 2014

bash printf + echo string


Vote count:

0




So I'm trying to print a string as a argument to a program in the terminal. However, my command doesn't seem to match the string, which I need. The string I need to print is:



aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$'\x14\x84\x04\x08'


My command:



`printf 'a%.0s' {1..76}; echo "$'\x14\x84\x04\x08'"`


Am I just making a stupid mistake?



asked 3 mins ago


1 Answer



Vote count:

0




Try like this,



~$ printf %100s |tr " " "a"; echo "$'\x14\x84\x04\x08'"
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$'\x14\x84\x04\x08'


answered 13 secs ago





Aucun commentaire:

Enregistrer un commentaire