TIP: Click on subject to list as thread! ANSI
echo: linux
to: MARK LEWIS
from: MAURICE KINAL
date: 2016-11-18 11:38:00
subject: two steps back

-={ 2016-11-18 06:38:25.244753537-05:00 }=-

Hey mark!

 ml> i'm not certain but i'm fairly sure that i've run some 2.2 PKTs
 ml> through the reader

Here is something I'd appreciate your input on;

---------- pkt type data vector generator starts
#!/bin/bash
origAddr="1:153/7001.0@fidonet"
destAddr="1:3634/12.73@fidonet"

##### divide and conquer ftn addresses
read origZone origNet origNode origPoint origDom <<< $(echo $origAddr | tr
':/.@' ' ')
read destZone destNet destNode destPoint destDom <<< $(echo $destAddr | tr
':/.@' ' ')

##### only required for types 2 and 2+
##### subtract 1 from month to match localtime() output (ie 0-11)
PKT_DATE=( $(date +"%Y %-m %-d %-H %-M %-S" | \
  awk 'BEGIN { OFS = "," } {print $1, $2-1, $3, $4, $5, $6}') )

echo -e "\e[1;31mtype 2 data vector:\e[0m"
echo
"$origNode,$destNode,${PKT_DATE[@]},0,2,$origNet,$destNet,0,0,,$origZone,$destZ
one,"
echo -e "\e[1;31mtype 2+ data vector:\e[0m"
echo
"$origNode,$destNode,${PKT_DATE[@]},0,2,$origNet,$destNet,255,1,,$origZone,$des
tZone,0,256,16,9,1,$origZone,$destZone,$origPoint,$destPoint,"
echo -e "\e[1;31mtype 2.2 data vector:\e[0m"
echo
"$origNode,$destNode,$origPoint,$destPoint,,2,2,$origNet,$destNet,255,0,,$origZ
one,$destZone,$origDom,$destDom,0"
---------- pkt type data vector generator ends 

Note that all the echo calls are one line or at least were when they left here.
 Also I used your Origin line address with the domain addition as the destAddr.
 Also, also added ansi colours (red) the the type echo's (see 'echo -e' calls).
 All output is pure ascii and the only thing I can see that could possibly
benefit from utf-8 encoding would be the domain names but then due to the byte
limitations that would be even more crippling than it already is.

Any and all criticism will be appreciated.

Life is good,
Maurice

... Wene þec þy betran, efn elne þis a þenden þu lifge.
    Train yourself for the better way, ever with courage as long as you live.
--- GNU bash, version 4.4.0(1)-release (x86_64-atom-linux-gnu)
* Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001.0)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.