File: filter

package info (click to toggle)
libsmi 0.1.7-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 10,364 kB
  • ctags: 2,173
  • sloc: ansic: 10,484; sh: 7,338; yacc: 6,150; lex: 1,524; makefile: 162
file content (19 lines) | stat: -rwxr-xr-x 479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
#
# filter SMIv1/v2 to get a comparable (but unreadable) format
#
# 1. strip off comments
# 2. condens white space
# 3. remove ambigious white space
# 4. strip off texts enclosed in double qoutes
# 5. convert blanks back to nl, and finally
# 6. sort

sed -e 's/\"[a-z]*\"//g' | \
sed -e 's/--[^\"-]*--//g' -e 's/--[^\"]*$//' | \
tr '\t\n' '  ' | \
sed -e 's/  */ /g' | \
sed -e 's/SIZE (/SIZE(/g' -e 's/ }/}/g' | \
sed -e 's/\"[^\"]*\"/\"\"/g' | \
tr ' ' '\n' | \
sort