22 lines
393 B
Bash
Executable File
22 lines
393 B
Bash
Executable File
#!/bin/bash
|
|
|
|
reponse=""
|
|
if [[ $# -ne 2 ]]
|
|
then
|
|
echo "Erreur ! Il n'y as pas assez d'arguments"
|
|
exit 1
|
|
fi
|
|
if [[ ! -f $1 ]]
|
|
then
|
|
echo "Erreur"
|
|
exit 2
|
|
fi
|
|
|
|
echo "" > $2
|
|
while read -r addr
|
|
do
|
|
x=$(expr substr $addr 1 8) && y=$(expr substr $addr 9 8) && z=$(expr substr $addr 17 8) && t=$(expr substr $addr 25 8)
|
|
addr_dot=$(echo $((2#$x)).$((2#$y)).$((2#$z)).$((2#$t)))
|
|
echo $addr_dot >> $2
|
|
done
|
|
exit |