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