We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed0f4cd commit 9c05ef0Copy full SHA for 9c05ef0
tests/extract_bytes_from_debuglog
@@ -0,0 +1,29 @@
1
+#!/bin/bash
2
+
3
+# The file name is passed as an argument to the script
4
+file=$1
5
6
+# Use awk to extract the relevant lines and the hex bytes
7
+hex_values=$(awk '
8
+BEGIN { output = "" }
9
+/VT100Parser.m:309/ {
10
+ # Split the line into fields using a colon as the delimiter
11
+ split($0, fields, ":")
12
+ # The hex bytes are in the last field, remove the trailing part
13
+ sub(/ \(.*/, "", fields[5])
14
+ # Add the hex bytes to the output string
15
+ output = output fields[5]
16
+}
17
+END {
18
+ # Trim leading and trailing spaces
19
+ gsub(/^ +| +$/, "", output)
20
+ print output
21
+}' $file)
22
23
+# Convert the hex values to ASCII
24
+for hex in $hex_values; do
25
+ printf "\x$hex"
26
+done
27
+echo
28
29
0 commit comments