wmii/util/cleanname

14 lines
163 B
Plaintext
Raw Normal View History

#!/bin/sh -f
echo "$@" |
awk '{
gsub(/\/+/, "/")
while(gsub("[^/]+/\.\.(/|$)", ""))
;
while(gsub("/\.(/|$)", "/"))
;
gsub(/\/+/, "/")
print
}'