Spaces in dir names breaks --exec?

12 views
Skip to first unread message

kyle.mar...@gmail.com

unread,
May 14, 2014, 4:38:00 PM5/14/14
to mu-di...@googlegroups.com
Hello all,

I have a message at "/Users/kms/Mail/zeck...@gmail.com/[Gmail].All Mail/cur/1390956834_1.10938.highlander,U=2,FMD5=844bb96d088d057aa1b32ac1fbc67b56:2,S"

Note the space in "All Mail". --exec doesn't like this:

$ mu find date:20040823 --exec "cat"   
cat: /Users/kms/Mail/zeck...@gmail.com/[Gmail].All: No such file or directory
cat: Mail/cur/1390956834_1.10938.highlander,U=2,FMD5=844bb96d088d057aa1b32ac1fbc67b56:2,S: No such file or directory

Should I file an issue on GitHub, or is this a configuration issue? I'm on Mac OS X, so it may also be a standards compliance issue.

– Kyle

Olaf Meeuwissen

unread,
May 14, 2014, 7:00:12 PM5/14/14
to mu-di...@googlegroups.com
It's the `cat` command that doesn't like the space. To fix this, `mu
find` should quote path names or escape characters with special meaning.
You can probably work around it with something like

mu find date:20040823 --fields="l" | while read filename; do
cat
done

Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962 Help support software freedom
http://www.fsf.org/jf?referrer=1962

kyle.mar...@gmail.com

unread,
May 14, 2014, 7:09:56 PM5/14/14
to mu-di...@googlegroups.com, olaf.me...@avasys.jp
I wasn't even using cat initially:


$ mu find date:20040823
Mon Aug 23 07:41:27 2004 .......

$ mu find date:20040823 --exec "mu view"

but nothing was printed out.

– Kyle

Olaf Meeuwissen

unread,
May 14, 2014, 10:06:23 PM5/14/14
to mu-di...@googlegroups.com

kyle.mar...@gmail.com writes:

>> On Wednesday, May 14, 2014 6:00:12 PM UTC-5, Olaf Meeuwissen wrote:
>> kyle.mar...@gmail.com writes:
>>
>> > Hello all,
>> >
>> > I have a message at "/Users/kms/Mail/zeck...@gmail.com/[Gmail].All
>> >
> Mail/cur/1390956834_1.10938.highlander,U=2,FMD5=844bb96d088d057aa1b32ac1fbc67b56:2,S"
>> >
>> > Note the space in "All Mail". --exec doesn't like this:
>> >
>> > $ mu find date:20040823 --exec "cat"
>> > cat: /Users/kms/Mail/zeck...@gmail.com/[Gmail].All: No such file or
>> > directory
>> > cat:
>> >
> Mail/cur/1390956834_1.10938.highlander,U=2,FMD5=844bb96d088d057aa1b32ac1fbc67b56:2,S:
>> > No such file or directory
>> >
>> > Should I file an issue on GitHub, or is this a configuration issue? I'm
> on
>> > Mac OS X, so it may also be a standards compliance issue.
>>
>> It's the `cat` command that doesn't like the space. To fix this, `mu
>> find` should quote path names or escape characters with special meaning.
>> You can probably work around it with something like
>>
>> mu find date:20040823 --fields="l" | while read filename; do
>> cat
>> done
>
> I wasn't even using cat initially:
>
> $ mu find date:20040823
> Mon Aug 23 07:41:27 2004 .......
>
> $ mu find date:20040823 --exec "mu view"
>
> but nothing was printed out.

The exact command doesn't matter, really. It the command line parsing
that sees the file name as two separate arguments. For the exact same
reason you are using double quotes around the "mu view" above. Saying

mu find date:20040823 --exec mu view

will treat the "view" bit as part of the search expression instead of
the command.

Dirk-Jan C. Binnema

unread,
May 15, 2014, 2:04:37 AM5/15/14
to mu-di...@googlegroups.com, olaf.me...@avasys.jp

On Wednesday May 14 2014, kyle.mar...@gmail.com wrote:
>> On Wednesday, May 14, 2014 6:00:12 PM UTC-5, Olaf Meeuwissen wrote:

>> > I have a message at "/Users/kms/Mail/zeck...@gmail.com/[Gmail].All
>> >
> Mail/cur/1390956834_1.10938.highlander,U=2,FMD5=844bb96d088d057aa1b32ac1fbc67b56:2,S"
>> >
>> > Note the space in "All Mail". --exec doesn't like this:

>> It's the `cat` command that doesn't like the space. To fix this, `mu
>> find` should quote path names or escape characters with special meaning.
>> You can probably work around it with something like
>>
>> mu find date:20040823 --fields="l" | while read filename; do
>> cat
>> done

Thanks Olaf!

One could argue whether it's mu's job to encode the output, or whatever
tool is used to read it, but I suppose it makes sense for mu to do
so... I've pushed some changes for this, which should take care of the
shell-encoding. Hope this doesn't break things for anyone...

Cheers,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Kyle Marek-Spartz

unread,
May 15, 2014, 10:49:01 AM5/15/14
to Abridged recipients, Abridged recipients, Olaf Meeuwissen
Thanks!

Kyle Marek-Spartz



On May 15, 2014, 1:04:37 AM, Dirk-Jan C. Binnema <dj...@djcbsoftware.nl> wrote:
On Wednesday May 14 2014, mailto:kyle.mar...@gmail.com


On Wednesday, May 14, 2014 6:00:12 PM UTC-5, Olaf Meeuwissen wrote:
> > > I have a message at "/mailto:Users/kms/Mail/zeck...@gmail.com/[Gmail].All Mail/cur/1390956834_1.10938.highlander,U=2,FMD5=844bb96d088d057aa1b32ac1fbc67b56:2,S"

> > > > Note the space in "All Mail". --exec doesn't like this:
> > It's the `cat` command that doesn't like the space. To fix this, `mu find` should quote path names or escape characters with special meaning. You can probably work around it with something like mu find date:20040823 --fields="l" | while read filename; do cat done
Thanks Olaf!

One could argue whether it's mu's job to encode the output, or whatever
tool is used to read it, but I suppose it makes sense for mu to do
so... I've pushed some changes for this, which should take care of the
shell-encoding. Hope this doesn't break things for anyone...

Cheers,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland

pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

--
You received this message because you are subscribed to a topic in the Google Groups "mu-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mu-discuss/LeoBGaFg7pM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mailto:mu-discuss+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout


Reply all
Reply to author
Forward
0 new messages