#-------------------------------------------------- # Procedure to filter system version specifications # # Input is received from stdin # Output wll be sent to stdout # # Input format # [-] # # Output format # # # o only the first two numeric fields are kept # o separators ('-' or '.') are all filtered out # #-------------------------------------------------- read value c=`echo $value | sed -e 's#[-.0-9]##g'` v=`echo $value | \ sed -e 's#[^-.0-9]##g' -e 's#^[^0-9]##' -e 's#[-]#.#g' | \ cut -d '.' -f1,2 | \ sed -e 's#[-.]##g'` echo ${c}${v}