0

I have an application (not my own) that I run on two different CentOS6 machines with 2.6.32-696 kernels. The application is a command line driven (it has its own prompt once started) data analysis and graphing routine. On one machine, command line completion works from the app for files (i.e. if I say "read bob" it lists all the files starting with "bob" in the current directory). On the other machine, completion doesn't work at all. I've tried different shells, and looked at environments variables, but haven't been able to identify anything to explain the different behavior. Are there general system settings I can look for or compare between the machines to try to resolve this inconsistent behavior?

Additional details in response to comments:

shells I have tried:
on the machine where completion works, it works running from bash (default on that machine) and it works if I switch to tcsh.

on the machine where completion fails, it fails from both tcsh (default on that machine) and bash.

New information:
I just discovered that on the machine where I can't get filename completion from the apps CLI, I do get completion if I login as root (not su or sudo but interactive console login as root). I would guess this then points to a permissions or environment issue, but I don't know what to look for...

PaulV
  • 9
  • 1
    Add the output of complete -p <name-of-application> (assuming bash) from both systems to the question, please. Also, "different shells"? Completion settings are shell-specific, so please which shells you are using as well. – muru Mar 29 '18 at 01:53
  • 1
    It is not clear whether the application is actually using the system's shell or whether it implements its own command line interface. Please clarify this. If it has its own CLI, is it using Readline or some other library? – Kusalananda Mar 29 '18 at 06:04
  • from bash on both machines compete -p physica returns: bash: complete: physica: no completion specification – PaulV Mar 29 '18 at 12:29
  • I only have the source code from a slightly different version and I don't know the structure very well, but it is linked against readline. – PaulV Mar 29 '18 at 12:31
  • You could have a look at the output of shopt nullglob. There is a bug (which I have not reported yet) in Debian Jessie (not in Ubuntu but something similar may be the case with CentOS): If nullglob is set too early in the login process then completion gets destroyed. Does it work if you start a shell like this? bash --init-file /dev/null --noprofile – Hauke Laging Mar 30 '18 at 11:48
  • Starting bash that way still does not give me completion in the app CLI. – PaulV Mar 30 '18 at 15:32

1 Answers1

1

Having shell option nullglob set will cause your problem. From the command line, type shopt nullglob to see whether the setting is on or off. In order to turn it off, run shopt -u nullglob.

While we're at that, the same is true for option failglob, so check that also.

user1404316
  • 3,078
  • from bash on both machines the shopt -u command returns nothing for both nullglob and failblog. (literally nothing, it was like hitting return). – PaulV Mar 29 '18 at 12:35
  • @PaulV : What were you expecting? The issue is, once you unset those options, does tab completion work, or not? – user1404316 Mar 29 '18 at 17:07
  • sorry, my misreading + ignorance. shopt shows both nullglob and failglob are off. – PaulV Mar 30 '18 at 15:26