David Kastrup <[email protected]> writes: > I won't rule out that there is a possibility to let ~ through unquoted > in some contexts and get mostly correct behavior, but if you do things > like > > sudo make install > > and suddenly everything lands with a different user than configure > thought, stuff will not be pretty either.
> What I'm saying is that "fixing" this without breaking other things > might involve a whole lot more of work than bargained for. I don't know if it will help with the problems you had in mind, but I recall that the bash-completion package has this nice function: __expand_tilde_by_ref Excerpt from the comment: # We want to expand ~foo/... to /home/foo/... to avoid problems when # word-to-complete starting with a tilde is fed to commands and ending up # quoted instead of expanded. # Only the first portion of the variable from the tilde up to the first slash # (~../) is expanded. The remainder of the variable, containing for example # a dollar sign variable ($) or asterisk (*) is not expanded. # Example usage: # # $ v="~"; __expand_tilde_by_ref v; echo "$v" # # Example output: # # v output # -------- ---------------- # ~ /home/user # ~foo/bar /home/foo/bar # ~foo/$HOME /home/foo/$HOME # ~foo/a b /home/foo/a b # ~foo/* /home/foo/* The code is lines 960-1000 at : http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=blob;f=bash_completion;hb=HEAD Regards, -- Nico. _______________________________________________ auctex mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex
