summaryrefslogtreecommitdiffstats
path: root/bin/ls-bre
blob: ae978895cc14e443eb9a5615445f84b632c313b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#! /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
    '