.\" $Id: curly.man,v 3.8 2012/02/29 23:51:34 ksb Exp $ .\" by Kevin Braunsdorf .\" $Compile: Display%h .\" $Display: ${groff:-groff} -Tascii -man %f |${PAGER:-less} .\" $Display(*): ${groff:-groff} -T%s -man %f .\" $Install: %b -mDeinstall %o %f && cp %f $DESTDIR/usr/local/man/man1/curly.1 && ln $DESTDIR/usr/local/man/man1/curly.1 $DESTDIR/usr/local/man/man1/uncurly.1 .\" $Deinstall: ${rm-rm} -f $DESTDIR/usr/local/man/[cm]a[nt]1/curly.1* $DESTDIR/usr/local/man/[cm]a[nt]1/uncurly.1* .TH CURLY 1 LOCAL .SH NAME curly, uncurly - expand or build csh-like path expressions .SH SYNOPSIS .ds PN "curly .ds PA "uncurly \fI\*(PN\fP [\fIexpressions\fP] .br \fI\*(PN\fP \fB\-h\fP .br \fI\*(PN\fP \fB\-V\fP .br \fI\*(PA\fP [\-\fIdepth\fP] [\fInames\fP] .br \fI\*(PA\fP \fB\-h\fP .br \fI\*(PA\fP \fB\-V\fP .SH DESCRIPTION .B Curly expands a \fBcsh\fP(1) curly brace expression. Such an expression is of the form .RS prefix{E1,E2,E3}suffix .RE which expands to .RS .nf prefixE1suffix prefixE2suffix prefixE3suffix .fi .RE any subexpressions are also expanded. .PP .B Uncurly compresses a given path expression into a minimal curly expression. Thus .RS \fI\*(PA\fP ab.c ab.h de.c de.h ef.c ef.h .RE produces this output .RS {ab,de,ef}.{c,h} .RE .PP Either product will run in a filter mode if no arguments are provided. .SH OPTIONS Both programs take the standard help (\fB\-h\fP) and version (\fB\-V\fP) options. .P In addition \fB\*(PA\fP takes an integer \-\fIdepth\fP option to limit the depth of the compression search. .SH EXAMPLES .TP cd; find . \-depth \-print | uncurly >/tmp/files.u save a compressed list of the files in my home directory in /tmp/files.u. .TP \fI\*(PN\fP /tmp/mylist.u Compress a sorted list of the names in /tmp/mylist, but limit the compression to 2 nested levels of curlies. .SH 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 \*(lqab.h\*(rq and \*(lqab.c\*(rq in the first example creates a much longer pattern: .nf $ uncurly \fBab.h ab.c\fP de.c de.h ef.c ef.h ab.{h,c} {de,ef}.{c,h} .fi Given the liberty to reorder the input list we could reduce that to the much sorter string (by sorting the suffix expressions). .SH AUTHOR Kevin Braunsdorf .br curly @ ksb.npcguild.org.noSpam .SH "SEE ALSO" .hlm 0 csh(1), find(1), xargs(1), glob(1l), xapply(1l), oue(1l)