source: CMT/v1r16p20040901/mgr/cmt_filter_version.sh @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 682 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
19read value
20
21c=`echo $value | sed -e 's#[-.0-9]##g'`
22v=`echo $value | \
23   sed -e 's#[^-.0-9]##g' -e 's#^[^0-9]##' -e 's#[-]#.#g' | \
24   cut -d '.' -f1,2 | \
25   sed -e 's#[-.]##g'`
26
27echo ${c}${v}
28
Note: See TracBrowser for help on using the repository browser.