source: CMT/v1r20p20080222/mgr/cmt_filter_version.sh

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

See C.L. 338

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 588 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>
13#
14#   o only the first two numeric fields are kept
15#   o separators ('-' or '.') are all filtered out
16#
17#--------------------------------------------------
18
19exec sed -n '
20h
21s#[-.0-9]##g
22x
23s#[^-.0-9]##g
24s#^[^0-9]##
25y#-.#  #
26s#^\([0-9]*\) *\([0-9]*\) *.*#\1\2#
27G
28s#\(.*\)\n\(.*\)#\2\1#p
29'
Note: See TracBrowser for help on using the repository browser.