forked from decal/werdlists
- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpath2word
More file actions
Latest commit
22 lines (18 loc) · 525 Bytes
/
Copy pathpath2word
File metadata and controls
22 lines (18 loc) · 525 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
#
# Using file containing paths as input, output words (file and directory names.)
#
# Written By: Derek Callaway [decal (AT) sdf {D0T} org]
# Last Modified: Mon Dec 18 22:55:17 PST 2017
# Tested On: Ubuntu 16.04.3 LTS
#
if [ !"$1" ]
then#
echo"usage: $0 PATHFILE"
echo' PATHFILE location of file containing list of path names to convert to words'
exit 64
fi
(for s in`cat -- "$1"`
doecho$s| tr '/''\n'
done) | sed -r 's![?]+.*$!!g'| sed -r 's![#].*$!!g'| sort -u
exit 0