stockholm/bin/ls-bre

13 lines
194 B
Plaintext
Raw Normal View History

2015-05-20 23:56:08 +00:00
#! /bin/sh
# ls-bre : directory -> BRE
# Create a BRE from the files in a directory.
set -euf
ls "$1" \
| tr \\n / \
| sed '
s:[\.\[\\\*\^\$]:\\&:g
s:/$::
s:/:\\|:g
'