[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: svnmucc

From: Andrew Reedick <Andrew.Reedick_at_cbeyond.net>
Date: Mon, 18 Nov 2013 10:24:05 -0500

> -----Original Message-----
> From: Nico Kadel-Garcia [mailto:nkadel_at_gmail.com]
> Sent: Monday, November 18, 2013 7:12 AM
> To: Vladislav Javadov
> Cc: Blair Zajac; Andreas Mohr; Geoff Rowell; users_at_subversion.apache.org
> Subject: Re: svnmucc
>
> Brother, unweaving the quotes is its own problem. You see, most filesystems allow single quotes and double quotes in the filenames themselves. Hilarity will ensue.
>
> On Sun, Nov 17, 2013 at 4:19 AM, Vladislav Javadov <vapaamies_at_yandex.ru> wrote:
> > BZ> The reason to support this syntax with command and arg on separate
> > BZ> lines is to support files with whitespaces in the names
> >
> > But what about quotes? Most OSes and programs accept quoted file names
> > containing spaces. Single-line commands are more readable, IMHO.
> >
> >
> > --
> > WBR,
> > Vladislav Javadov
> >

And this is why I switched from bash to xash (aka "xml bash"). All my commands are now entered in xml format. Finally, no more -print0 and nested/escaped quotes nonsense!

Example:
        cp -p foo bar
Becomes
        <command><arg>cp</arg><arg>-p</arg><arg>foo</arg><arg>bar</arg></command>

And multi-line commands and scripts go from:
      # Contrived example
        find . -type f -print0 | while read -d $'\0' i
        do
           sed 's/e/E/g' "$i"
        done | tee foo.txt 2>&1
to:
<commands>
        <command>
                <arg>find</arg>
                <arg>.</arg>
                <arg>-type</arg>
                <arg>f</arg>
        </command>
        <pipe/>
        <command>
                <arg>while</arg>
                <arg>read</arg>
                <arg>i</arg>
        </command>
        <command>
                <arg>do</arg>
        </command>
        <command>
                <arg>sed</arg>
                <arg>'s/e/E/g'</arg>
                <arg>$i</arg>
        </command>
        <command>
                <arg>done</arg>
        </command>
        <pipe/>
        <tee stdout_format="human_ascii">
                <file>foo.txt</file>
        </tee>
        <redirects>
                <redirect><file_no from="2" to="1"/></redirect>
        </redirects>
</commands>

Simple and inherently accurate, natch?
Received on 2013-11-18 16:25:59 CET

This is an archived mail posted to the Subversion Users mailing list.