source: CMT/v1r24/mgr/cmt_filter3_version.sh

Last change on this file was 474, checked in by rybkin, 16 years ago

See C.L. 375

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 628 bytes
Line 
1
2#--------------------------------------------------
3# Procedure to filter system version specifications
4#
5#   Input is received from stdin
6#   Output wll be sent to stdout
7#
8#   Input format
9#    <some letters>[-]<dot separated numeric fields>
10#
11#   Output format
12#    <some letters><field1><field2><field3>
13#
14#   o only the first three numeric fields are kept
15#   o separators ('-' or '.') are all filtered out
16#
17#--------------------------------------------------
18
19export LC_ALL=C
20exec sed -n '
21h
22s#[-.0-9]##g
23x
24s#[^-.0-9]##g
25s#^[^0-9]##
26y#-.#  #
27s#^\([0-9]*\) *\([0-9]*\) *\([0-9]*\) *.*#\1\2\3#
28G
29s#\(.*\)\n\(.*\)#\2\1#p
30'
Note: See TracBrowser for help on using the repository browser.