Andrew Reedick
unread,Nov 18, 2013, 10:24:05 AM11/18/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Nico Kadel-Garcia, Vladislav Javadov, Blair Zajac, Andreas Mohr, Geoff Rowell, us...@subversion.apache.org
> -----Original Message-----
> From: Nico Kadel-Garcia [mailto:
nka...@gmail.com]
> Sent: Monday, November 18, 2013 7:12 AM
> To: Vladislav Javadov
> Cc: Blair Zajac; Andreas Mohr; Geoff Rowell;
us...@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 <
vapa...@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?