
#--------------------------------------------------
# Procedure to filter system version specifications
#
#   Input is received from stdin
#   Output wll be sent to stdout
#
#   Input format
#    <some letters>[-]<dot separated numeric fields>
#
#   Output format
#    <some letters><field1><field2><field3>
#
#   o only the first three numeric fields are kept
#   o separators ('-' or '.') are all filtered out
#
#--------------------------------------------------

export LC_ALL=C
exec sed -n '
h
s#[-.0-9]##g
x
s#[^-.0-9]##g
s#^[^0-9]##
y#-.#  #
s#^\([0-9]*\) *\([0-9]*\) *\([0-9]*\) *.*#\1\2\3#
G
s#\(.*\)\n\(.*\)#\2\1#p
'
