emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#29319: closed (Potential tee bug)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#29319: closed (Potential tee bug)
Date: Thu, 16 Nov 2017 16:57:02 +0000

Your message dated Thu, 16 Nov 2017 10:56:08 -0600
with message-id <address@hidden>
and subject line Re: bug#29319: Potential tee bug
has caused the debbugs.gnu.org bug report #29319,
regarding Potential tee bug
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
29319: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29319
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Potential tee bug Date: Thu, 16 Nov 2017 17:27:58 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
Hello,

when I run the command

echo test | tee "~/Desktop/test.txt"

I get the following error message:

tee: ~/Desktop/test.txt: No such file or directory

But when I run

echo test | tee "/home/simon/Desktop/test.txt"

, which is the same directory, tee works fine.

If I omit the "", everything works fine as well.
Is this behavior intended? I don't see why the "" should change the behavior like this.


Best regards
Simon



--- End Message ---
--- Begin Message --- Subject: Re: bug#29319: Potential tee bug Date: Thu, 16 Nov 2017 10:56:08 -0600 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
tag 29319 notabug
thanks

On 11/16/2017 10:27 AM, Simon Convent wrote:
> Hello,
> 
> when I run the command
> 
> echo test | tee "~/Desktop/test.txt"
> 
> I get the following error message:
> 
> tee: ~/Desktop/test.txt: No such file or directory

That's because your use of quoting prevents shell tilde-expansion.  Proof:

$ echo "~/Desktop"
~/Desktop

> 
> But when I run
> 
> echo test | tee "/home/simon/Desktop/test.txt"
> 
> , which is the same directory, tee works fine.

No, that's not the same string.
Proof:

$ echo ~/Desktop
/home/eblake/Desktop

> 
> If I omit the "", everything works fine as well.

That's because without the "", your shell can do tilde-expansion.

> Is this behavior intended? I don't see why the "" should change the
> behavior like this.

dd is not the change in behavior here, but your incorrect understanding
of how shell quoting works.  As such, I'm marking this as not a
coreutils bug (as the argv[] passed to dd is AFTER the shell has already
done tilde-expansion and quote removal, so dd is faithfully trying to
open whatever literal string the shell handed it).  But feel free to
follow up with more questions if you need pointers on learning to use
the shell properly.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]