3

I'm on Ubuntu 10.04 and I've ran into a little bit of a snag with bash completions within backticks. Here's an example to illustrate:

I save streaming URL:s to my radio-stations in text files, and I usually start listening by typing

$ mplayer `cat ~/stations/some.fm`

It would be great if I could use tab completion at:

$ mplayer `cat ~/stations/<tab>

In this case, however, the tab completion doesn't seem to match files, only directories. So I get

$ mplayer `cat ~/stations/<tab>
subdir1       subdir2
$ mplayer `cat ~/stations/

But no files! A workaround is to use

$ cat ~/stations/some.fm | xargs mplayer

In this case tab completion works, but I would prefer to use the backtick version. Not for this example alone, but this bit me in many other situations as well.

Does anyone here know how to fix this / where the filter is defined?

studiohack
  • 13,477

1 Answers1

3

Use:

$ mplayer $(cat ~/stations/<tab>

instead; it does the same thing.

cYrus
  • 22,335