Re: [opensuse] opensuse 13.2 sh command broken
On 11/12/2014 05:19 PM, John Andersen wrote:
On 11/12/2014 01:56 PM, Mark Hounschell wrote:
On 11/12/2014 04:48 PM, John Andersen wrote:
On 11/12/2014 01:42 PM, Mark Hounschell wrote:
For as long as I can remember the sh command allowed for command completion via the tab key. As of 13.2 it no longer does. Who broke it?
Mark
Probably You, since it works for me. ;-) If the portion you keyed in before hitting tab is not unique, it will show possibles upon the next tab key. If you keyed something that was unique enough, the first tab will show the full command.
Sh is nothing but a link to bash. There exists more than one such link, one in /bin and one in /usr/bin.
Why are you sending email to me and not the list?
People who want help should not be so touchy.
Anyway, I broke nothing. I just did a fresh install and it does not work. Normal command completion works fine as long as it is executable. When "sh part_of_pathname" completion doesn't work on any of the 3 13.2 boxes I have.
Mark
While sitting in bash I type:
sh /etc/s and then I hit tab. Nothing happens until the next tab.
jsa@poulsbo:~> sh /etc/s samba/ selinux/ slp.reg.d/ sound/ susehelp.d/ sane.d/ sensors.d/ smartd_warning.sh ssh/ sysconfig/ sasl2/ sgml/ snapper/ ssl/ sysctl.d/ security/ skel/ snmp/ sudoers.d/ systemd/ jsa@poulsbo:~> sh /etc/s
While sitting in SH (which is bash in disguise) I type /etc/s and hit tab Again nothing happens on the first tab, the second tab shows a list
sh-4.2$ /etc/s samba/ selinux/ slp.reg.d/ sound/ susehelp.d/ sane.d/ sensors.d/ smartd_warning.sh ssh/ sysconfig/ sasl2/ sgml/ snapper/ ssl/ sysctl.d/ security/ skel/ snmp/ sudoers.d/ systemd/ sh-4.2$ /etc/s
And if I did type enough to be unique
sh-4.2$ /etc/sou and hit tab, it shows the matching path node
sh-4.2$ /etc/sound/ one more tab shows the next (only) subdirectory
sh-4.2$ /etc/sound/events/
With no command portion it assumes you want to execute something, and won't act unless there is a directory or an executable.
If you give it a command it will keep adding portions with each tab till it finds something that makes sense.
sh-4.2$ ls /etc/sou tab sh-4.2$ ls /etc/sound/ tab sh-4.2$ ls /etc/sound/events/ tab sh-4.2$ ls /etc/sound/events/g tab tab (it shows the list).... gnome-2.soundlist gtk-events-2.soundlist sh-4.2$ ls /etc/sound/events/g
Yes, Yes, I know how it is supposed to work and actually everything you show above works here just like above. You are not actually doing what doesn't work here. Here is what doesn't work here and should. As an example, in the directory scripts I have. markh@harley:~> cd scripts markh@harley:~/scripts> ls -al total 32 drwxr-xr-x 2 markh users 4096 Nov 13 08:12 ./ drwxr-xr-x 133 markh users 20480 Nov 13 08:11 ../ -rwxr-xr-x 1 markh users 1454 Nov 13 08:12 sh.include* -rw-r--r-- 1 markh users 1454 Nov 13 08:12 sh.include1 When I do this: markh@harley:~/scripts>sh ./sh. TAB TAB TAB Nothing is displayed. It should show all the files starting with "sh." and it does on all my installations previous to 13.2. But does not on any of my 13.2 machines. Now if I markh@harley:~/scripts> sh sh-4.2$ sh-4.2$ ./sh.include sh.include sh.include sh.include1 sh-4.2$ ./sh.include sh.include All is good. ??? Mark -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Mark Hounschell <markh@compro.net> [11-13-14 08:23]: [...]
When I do this:
markh@harley:~/scripts>sh ./sh. TAB TAB TAB
Nothing is displayed. It should show all the files starting with "sh." and it does on all my installations previous to 13.2. But does not on any of my 13.2 machines.
Now if I
markh@harley:~/scripts> sh sh-4.2$ sh-4.2$ ./sh.include sh.include sh.include sh.include1 sh-4.2$ ./sh.include sh.include
All is good.
???
does: ls -ls `which sh` /usr/bin/sh -> /bin/bash* -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/13/2014 08:42 AM, Patrick Shanahan wrote:
does: ls -ls `which sh` /usr/bin/sh -> /bin/bash*
Yes, but as the man page makes clear, the behaviour when invoked as 'sh' is not the same as that of 'bash' -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/13/2014 08:22 AM, Mark Hounschell wrote:
Nothing is displayed. It should show all the files starting with "sh." and it does on all my installations previous to 13.2. But does not on any of my 13.2 machines.
IIR ... While there is a completion mechism built in to bash, see the MAN page, there is a lot of the completion that has to be set up. This is done when the shell initializes ... See ".profile" and ".bash_profile" and ".bashrc". The redefinition of completion in /etc/profile.d/* may also be pertient. I'm not running 13.2 yet, but in my shell startup on 13.1 these are called and part of my interactive shell. I note that you go on to say
Now if I
markh@harley:~/scripts> sh sh-4.2$ sh-4.2$ ./sh.include sh.include sh.include sh.include1 sh-4.2$ ./sh.include sh.include
All is good.
Well what you are doing is starting an interactive subshell, so see the man page: <quote> If bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well. When invoked as an interactive login shell, or a non-interactive shell with the --login option, it first attempts to read and execute commands from /etc/profile and ~/.profile, in that order. The --noprofile option may be used to inhibit this behavior. When invoked as an interactive shell with the name sh, bash looks for the variable ENV, expands its value if it is defined, and uses the expanded value as the name of a file to read and execute. Since a shell invoked as sh does not attempt to read and execute commands from any other startup files, the --rcfile option has no effect. A non-interactive shell invoked with the name sh does not attempt to read any other startup files. When invoked as sh, bash enters posix mode after the startup files are read. </quote> Note that last line! The key point here is that 'sh' is not the same as 'bash'. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Anton Aylward <opensuse@antonaylward.com> [11-13-14 09:03]: [...]
Well what you are doing is starting an interactive subshell, so see the man page:
<quote> If bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well. When invoked as an interactive login shell, or a non-interactive shell with the --login option, it first attempts to read and execute commands from /etc/profile and ~/.profile, in that order. The --noprofile option may be used to inhibit this behavior. When invoked as an interactive shell with the name sh, bash looks for the variable ENV, expands its value if it is defined, and uses the expanded value as the name of a file to read and execute. Since a shell invoked as sh does not attempt to read and execute commands from any other startup files, the --rcfile option has no effect. A non-interactive shell invoked with the name sh does not attempt to read any other startup files. When invoked as sh, bash enters posix mode after the startup files are read. </quote>
Note that last line!
The key point here is that 'sh' is not the same as 'bash'.
I *almost* agree, but with: ls -la /bin/bash /usr/bin/sh -rwxr-xr-x 1 root root 656584 Oct 15 10:35 /bin/bash* lrwxrwxrwx 1 root root 9 Oct 15 10:35 /usr/bin/sh -> /bin/bash* that seem not so. I have a server running 13.1 and sh is /bin/sh, a link to /bin/bash whereas in > 13.1 sh has been moved to /usr/bin/sh ???? -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 11/13/2014 09:11 AM, Patrick Shanahan wrote:
The key point here is that 'sh' is not the same as 'bash'.
I *almost* agree, but with: ls -la /bin/bash /usr/bin/sh -rwxr-xr-x 1 root root 656584 Oct 15 10:35 /bin/bash* lrwxrwxrwx 1 root root 9 Oct 15 10:35 /usr/bin/sh -> /bin/bash*
that seem not so.
I mean OPERATIONALLY. Please read the man page that I quoted from. The file, the binary, may be the same but the operation of the program when invoked as 'sh' is not the same as the operational of the program when invoked as 'bash'. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Anton Aylward
-
Mark Hounschell
-
Patrick Shanahan