forked from Mirrors/freeswitch
3abb7730b2
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3772 d0543943-73ff-0310-b7d9-9358b9ac24b2
13 lines
235 B
Perl
Executable File
13 lines
235 B
Perl
Executable File
#!/usr/bin/perl
|
|
# Turn C-style octal escapes into binary.
|
|
# Call as "echo -n 'ab\0\001cd' | oct2bin > out.binmode".
|
|
|
|
binmode STDOUT;
|
|
|
|
while (<>) {
|
|
s/\\(\d\d\d)/chr(oct($1))/ge;
|
|
s/\\0/chr(0)/ge;
|
|
s/\\\\/\\/g;
|
|
print $_;
|
|
}
|