Unwanted blank after command line <tab> expansion

Ralf Mardorf kde.lists at yahoo.com
Sun Sep 4 09:05:02 UTC 2022


On Sun, 2022-09-04 at 09:08 +0100, Colin Law wrote:
> Is this a repeated post?  I am sure I saw it a few days ago.

Hi,

yes it is.

https://lists.ubuntu.com/archives/ubuntu-users/2022-August/308287.html

On Sat, 2022-09-03 at 22:26 -0700, MR ZenWiz wrote:
> I tried Googling this and looking through the (massive) bash man page
> and couldn't identify anything that looked appropriate.

On Wed, 2022-08-31 at 13:27 +1000, Karl Auer wrote:
> On Tue, 2022-08-30 at 19:31 -0700, MR ZenWiz wrote:
> > How can I prevent this stupid space from appearing?
> 
> man bash, look for "nospace" ?
> 
> Untried, just guessing.

I haven't tried this and the output is from the Arch Linux, not the
Ubuntu manual page:

~~~
[rocketmouse at archlinux ~]$ man bash | grep nospace -B14
              Other options, if specified, have the following meanings.  The arguments to the -G, -W, and -X options (and, if necessary, the -P and -S options) should be quoted  to  pro‐
              tect them from expansion before the complete builtin is invoked.
              -o comp-option
                      The comp-option controls several aspects of the compspec's behavior beyond the simple generation of completions.  comp-option may be one of:
                      bashdefault
                              Perform the rest of the default bash completions if the compspec generates no matches.
                      default Use readline's default filename completion if the compspec generates no matches.
                      dirnames
                              Perform directory name completion if the compspec generates no matches.
                      filenames
                              Tell  readline  that  the  compspec generates filenames, so it can perform any filename-specific processing (like adding a slash to directory names, quoting
                              special characters, or suppressing trailing spaces).  Intended to be used with shell functions.
                      noquote Tell readline not to quote the completed words if they are filenames (quoting filenames is the default).
                      nosort  Tell readline not to sort the list of possible completions alphabetically.
                      nospace Tell readline not to append a space (the default) to words completed at the end of the line.
~~~


I don't know how to use the "nospace" option.

~~~
[rocketmouse at archlinux ~]$ bash -o nospace -c roxterm
bash: line 0: bash: nospace: invalid option name
~~~

However, the behavior on Arch Linux is the same as on the OP's Ubuntu
install.

While
~~~
[rocketmouse at archlinux ~]$ $HOM
~~~
becomes
~~~
[rocketmouse at archlinux ~]$ $HOME/
~~~
without a space,
~~~
[rocketmouse at archlinux ~]$ cp -ai $HOM
~~~
becomes
~~~
[rocketmouse at archlinux ~]$ cp -ai $HOME
~~~
with a space behind the E.

Regards,
Ralf




More information about the ubuntu-users mailing list