From 5afd9958bf1fe0ad9390d650fdb196df6e5db9d2 Mon Sep 17 00:00:00 2001 From: Benji Date: Tue, 17 Nov 2026 16:05:02 +0100 Subject: [PATCH] sync: 2026-11-17 16:05 --- SCR/SCR1.2/TP08/bin2dot-with-for.sh | 14 ++++++++++++++ SCR/SCR1.2/TP08/ipv4-bin-data.dat | 3 +++ 2 files changed, 17 insertions(+) create mode 100755 SCR/SCR1.2/TP08/bin2dot-with-for.sh create mode 100644 SCR/SCR1.2/TP08/ipv4-bin-data.dat diff --git a/SCR/SCR1.2/TP08/bin2dot-with-for.sh b/SCR/SCR1.2/TP08/bin2dot-with-for.sh new file mode 100755 index 0000000..464993c --- /dev/null +++ b/SCR/SCR1.2/TP08/bin2dot-with-for.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [[ $# -lt 2 ]]; then + echo "usage: $0 " + exit 1 +fi + +for line in $(cat $1); do + l1=$(expr substr 1 8) + l2=$(expr substr 9 8) + l3=$(expr substr 18 8) + l4=$(expr substr 26 8) + echo "$((2#$l1)).$((2#$l2)).$((2#$l3)).$((2#$l4))." +done diff --git a/SCR/SCR1.2/TP08/ipv4-bin-data.dat b/SCR/SCR1.2/TP08/ipv4-bin-data.dat new file mode 100644 index 0000000..37aa898 --- /dev/null +++ b/SCR/SCR1.2/TP08/ipv4-bin-data.dat @@ -0,0 +1,3 @@ +10110010111000101000011101110010 +11100101110001010101100101010010 +00110010111001101000010001110010