El día Wednesday, October 20, 2010 a las 12:36:44AM +1100, andrew clarke escribió:
> I'd be personally more comfortable doing it in C or Python but I think > you can do this with tr -s. me too; > > Note: 0x15 == 25 octal; 0x0a == 12 octal. I don't recall if it's > possible to use hex values in csh arguments - if so, what is the > syntax? > > 0:28 ozzmo...@blizzard [~/tmp]printf 'Hello\25\12world.\12' > blah > > 0:28 ozzmo...@blizzard [~/tmp]hd blah > 00000000 48 65 6c 6c 6f 15 0a 77 6f 72 6c 64 2e 0a |Hello..world..| > 0000000e > > 0:28 ozzmo...@blizzard [~/tmp]tr -s '\25\12' '\25' < blah | hd > 00000000 48 65 6c 6c 6f 15 77 6f 72 6c 64 2e 15 |Hello.world..| > 0000000d I saw this, but this has the side affect to reduce any occourance of a duouble 0x1515 to 0x15: g...@current:~> printf '\25\25Hello\25\12world.\12' > blah g...@current:~> hd blah 00000000 15 15 48 65 6c 6c 6f 15 0a 77 6f 72 6c 64 2e 0a |..Hello..world..| 00000010 g...@current:~> tr -s '\25\12' '\25' < blah | hd 00000000 15 48 65 6c 6c 6f 15 77 6f 72 6c 64 2e 15 |.Hello.world..| Thanks anyway matthias -- Matthias Apitz t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e <g...@unixarea.de> - w http://www.unixarea.de/ _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"