Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
24ac1e6f
Commit
24ac1e6f
authored
May 30, 2000
by
Niels Möller
Browse files
* src/invert-defs: Improved awk-code to deal with repeated message
numbers. Thanks to bellman. Rev: src/invert-defs:1.5
parent
d0d1814b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/invert-defs
View file @
24ac1e6f
...
...
@@ -8,13 +8,16 @@ echo " * Do not edit. */"
echo
echo
"{"
sed
-e
's/^#define \(SSH_MSG_[A-Z_0-9][A-Z_0-9]*\)[ \t][ \t]*\([1-9][0-9]*\)[ \t]*$/\2 \1/'
-e
t
-e
d
\
|
sort
-nu
\
|
awk
'BEGIN{i=0;}
{ for(j=$1;i<j;i++) print "\"Unknown\"," ;
print "\"" $2 "\","; i++;}
END{for(;i<256;i++) print "\"Unknown\",";}'
sed
-e
's/^#define SSH_MSG_\([A-Z_0-9][A-Z_0-9]*\)[ \t][ \t]*\([1-9][0-9]*\)[ \t]*$/\2 \1/'
-e
t
-e
d
\
|
awk
' { kwds[$1] = kwds[$1] "|" $2; }
END { for (i = 0; i < 256; i++) {
x = kwds[i];
if (x == "")
print "\"Unknown\",";
else
print "\"" substr(x, 2) "\",";
}
}'
echo
"}"
echo
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment