On Sun 11 Apr 2021 at 10:45:22 (-0400), Greg Wooledge wrote: > On Sun, Apr 11, 2021 at 09:10:24AM -0500, David Wright wrote: > > For stdout, the problem is more serious. Every time you press TAB > > expecting remote filename completion, you receive the profile output > > from the other end, double-escaped (so a forest of backslashes). > > ...? What the *hell* are you even doing?
Steady on—you're the one who wrote "Profiles that scribble to stdout or stderr during login can break things like scp." I agreed with you, but Lee asked "Can you give an example of profiles that scribble to stderr during login breaking things like scp? I've tried to create that situation, but can't." You replied "Maybe you're right. I haven't touched that stuff in many years, so I might be repeating outdated advice, or I might have been making incorrect assumptions all along." So I temporarily modified my .bashrc to output, in turn, on stderr and stdout, just as a demonstration of what could happen, for Lee. That's what we do here. > Is this some sort of bash-completion nonsense? It's gotta be. > > So, yeah, if you're actually using bash-completion (*shudder*) Isn't that something of a value judgment? I think we can agree that we all use bash completion, even if we don't use bash-completion itself. We interrogate and complete filenames by pressing TAB, yes? > and if > your bash-completion is set up to issue ssh commands to retrieve the > names of remote files while you type, It's not "my bash-completion", but just the regular Debian package. I use it exactly how it comes out of the tin. (Obviously one needs to be using ssh keys rather than passwords, if anybody is thinking of trying this out.) Without bash-completion, when you type, say, $ scp -p foo someuser@somehost:bar and press TAB, what happens? The partial string "bar" gets matched against filenames that bash sees on the *local* machine. Where's the much-vaunted Network Transparency in that? I want to complete filenames and directories with those that exist on the remote host. Similarly, without bash-completion, you can type: $ scp -p someuser@somehost:bar but TAB won't be able to help you find a file you haven't got, but only to match ones you already have. Normal completion by bash doesn't give you that network transparency, bash-completion does. > then having unprotected noisy > commands in your dot files is an *extremely* bad idea. Correct, QED. Cheers, David.