CURLY(1)                                                              CURLY(1)



NAME
       curly, uncurly - expand or build csh-like path expressions

SYNOPSIS
       curly [expressions]
       curly -h
       curly -V
       uncurly [-depth] [-m length] [names]
       uncurly -h
       uncurly -V

DESCRIPTION
       Curly  expands  a csh(1) curly brace expression.  Such an expression is
       of the form
              prefix{E1,E2,E3}suffix
       which expands to
              prefixE1suffix
              prefixE2suffix
              prefixE3suffix
       any subexpressions are also expanded.

       Uncurly compresses a given path expression into a minimal curly expres-
       sion. Thus the list:
              uncurly ab.c ab.h de.c de.h ef.c ef.h
       produces this output:
              {ab,de,ef}.{c,h}

       Either  product will run in a filter mode if no arguments are provided.

OPTIONS
       -depth
              Limit the depth of the compression search.

       -h
              The common usage message is the only output.

       -m length
              Limit the total length of each compressed output line.

       -V
              The standard version information is the only output.

EXAMPLES
       cd; find . -depth -print | uncurly >/tmp/files.u
              save a compressed list of the files  in  my  home  directory  in
              /tmp/files.u.

       curly </tmp/files.u | xargs my-tool
              Use  xargs  to  run  my-tool  on  each  of  the  saved  names in
              /tmp/files.u.

       sort /tmp/mylist | uncurly -2 >/tmp/mylist.u
              Compress a sorted list of the names in  /tmp/mylist,  but  limit
              the compression to 2 nested levels of curlies.

       grep -v '#' /etc/mail/local-host-names| sort -u | uncurly -m 500
              Produce a compressed list of the hosts for which we accept mail.


BUGS
       Files with curly braces in their names are an obvious problem.

       An option to allow reordering the input elements to improve compression
       would  be  nifty.   For example swapping "ab.h" and "ab.c" in the first
       example creates a much longer pattern:
              $ uncurly ab.h ab.c de.c de.h ef.c ef.h
              ab.{h,c}
              {de,ef}.{c,h}
       Given the liberty to reorder the input list we could reduce that to the
       much sorter string (by effectively sorting the suffix expressions).

AUTHOR
       Kevin Braunsdorf
       curly @ ksb.npcguild.org.noSpam

SEE ALSO
       csh(1), find(1), xargs(1), glob(1l), xapply(1l), oue(1l)



                                     LOCAL                            CURLY(1)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | BUGS | AUTHOR | SEE ALSO