mirror of
https://github.com/0intro/wmii
synced 2024-11-24 22:59:45 +03:00
19 lines
273 B
Bash
Executable File
19 lines
273 B
Bash
Executable File
#!/bin/sh -f
|
|
|
|
echo "$@" |
|
|
awk -F'/+' '{
|
|
delete a
|
|
n = 0
|
|
for(i = 1; i <= NF; i++) {
|
|
if($i == ".." && n > 0 && a[n] != "..")
|
|
n--
|
|
else if($i != "" && $i != ".")
|
|
a[++n] = $i
|
|
}
|
|
s = ""
|
|
for(i = 1; i <= n; i++)
|
|
s = s "/" a[i]
|
|
print substr(s, 2)
|
|
}'
|
|
|