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

-={ 2016-11-20 09:40:28.319281684-05:00 }=-

Hey mark!

 ml> i want that conversion to binary so i can see it with some pkt
 ml> readers

Since you seem to be recieving my msg intact then here are the three types
inclufing the ascii comma delimited data vectors;

---------- ye olde gpm cut n' paste starts
#################### write pktHeaders
# generate Type 2 pktHeader
PKT_DATE=( $(date +"%Y %-m %-d %-H %-M %-S" | \
  awk 'BEGIN { OFS = "," } {print $1, $2-1, $3, $4, $5, $6}') )
echo
"$origNode,$destNode,${PKT_DATE[@]},0,2,$origNet,$destNet,0,0,,$origZone,$destZ
one," | \
  perl -e 'while(){@myarray = split(/,/, $_);};\
           print pack("S12C2a8S2a20", @myarray);' > $OUTPKT

# generate Type 2+ pktHeader
PKT_DATE=( $(date +"%Y %-m %-d %-H %-M %-S" | \
  awk 'BEGIN { OFS = "," } {print $1, $2-1, $3, $4, $5, $6}') )
echo
"$origNode,$destNode,${PKT_DATE[@]},0,2,$origNet,$destNet,255,1,,$origZone,$des
tZone,0,256,16,9,1,$origZone,$destZone,$origPoint,$destPoint," | \
  perl -e 'while(){@myarray = split(/,/, $_);};\
           print pack("S12C2a8S4C2S5I", @myarray);' > $OUTPKT

# generate Type 2.2 pktHeader
echo
"$origNode,$destNode,$origPoint,$destPoint,,2,2,$origNet,$destNet,255,0,,$origZ
one,$destZone,fidonet,fidonet,0" | \
perl -e 'while(){@myarray = split(/,/, $_);};\
         print pack("S4a8S4C2a8S2a8a8I", @myarray);' > $OUTPKT
---------- ye olde gpm cut n' paste ends

Feel free to edit them to suit, such as defining $OUTPKT.  ;-)

Also note that I duplicated PKT_DATE since I wanted to make sure that if you
only strip out the one type that you also include it for that type since it is
needed.

If you require anything else to complete the above please don't hesitate to
ask.

Life is good,
Maurice

... ðone wisdom ðe ðe God sealde ðær ðær ðu hiene befæstan mæge,
befæste.
    Wherever you can use the wisdom God gave you, use it.
--- GNU bash, version 4.4.0(1)-release (x86_64-atom-linux-gnu)
* Origin: Little Mikey's Brain - Ladysmith BC, Canada (1:153/7001)

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™.