[gentoo-user] trouble overriding a command name
I know this is trivial and apologize in advance for what must be a simple (non-gentoo) error on my part. In /home/gottlieb/bin/dia I have the following #!/bin/bash /usr/bin/dia --integrated ls -l /home/gottlieb/bin/dia gives -rwxr-xr-x 1 gottlieb gottlieb 38 Aug 28 11:28 /home/gottlieb/bin/dia echo $PATH gives /home/gottlieb/bin/:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2:/usr/games/bin which dia gives /home/gottlieb/bin/dia `which dia` correctly starts dia in integrated (one window) mode /home/gottlieb/bin/dia correctly starts in integrated mode /usr/bin/dia correctly starts dia in the default (two window) mode BUT plain dia incorrectly starts dia in the default mode. What am I missing? thanks, allan
Re: [gentoo-user] trouble overriding a command name
On 28/08/2014 16:42, gottl...@nyu.edu wrote: I know this is trivial and apologize in advance for what must be a simple (non-gentoo) error on my part. In /home/gottlieb/bin/dia I have the following #!/bin/bash /usr/bin/dia --integrated ls -l /home/gottlieb/bin/dia gives -rwxr-xr-x 1 gottlieb gottlieb 38 Aug 28 11:28 /home/gottlieb/bin/dia echo $PATH gives /home/gottlieb/bin/:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2:/usr/games/bin which dia gives /home/gottlieb/bin/dia `which dia` correctly starts dia in integrated (one window) mode /home/gottlieb/bin/dia correctly starts in integrated mode /usr/bin/dia correctly starts dia in the default (two window) mode BUT plain dia incorrectly starts dia in the default mode. You might need to run hash -r in your current shell. If that doesn't help then ensure that there is no alias. Incidentally, I would suggest that you write this in your script: exec /usr/bin/dia --integrated Refer to `help exec` for the reasoning. --Kerin
Re: [gentoo-user] trouble overriding a command name
On Thu, Aug 28, 2014 at 10:42 AM, gottl...@nyu.edu wrote: I know this is trivial and apologize in advance for what must be a simple (non-gentoo) error on my part. In /home/gottlieb/bin/dia I have the following #!/bin/bash /usr/bin/dia --integrated ls -l /home/gottlieb/bin/dia gives -rwxr-xr-x 1 gottlieb gottlieb 38 Aug 28 11:28 /home/gottlieb/bin/dia echo $PATH gives /home/gottlieb/bin/:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2:/usr/games/bin which dia gives /home/gottlieb/bin/dia `which dia` correctly starts dia in integrated (one window) mode /home/gottlieb/bin/dia correctly starts in integrated mode /usr/bin/dia correctly starts dia in the default (two window) mode BUT plain dia incorrectly starts dia in the default mode. What am I missing? What's the output of alias? What happens if you execute dia, in quotes? Regards. -- Canek Peláez Valdés Profesor de asignatura, Facultad de Ciencias Universidad Nacional Autónoma de México
Re: [gentoo-user] trouble overriding a command name
On Thu, Aug 28 2014, Kerin Millar wrote: On 28/08/2014 16:42, gottl...@nyu.edu wrote: I know this is trivial and apologize in advance for what must be a simple (non-gentoo) error on my part. In /home/gottlieb/bin/dia I have the following #!/bin/bash /usr/bin/dia --integrated ls -l /home/gottlieb/bin/dia gives -rwxr-xr-x 1 gottlieb gottlieb 38 Aug 28 11:28 /home/gottlieb/bin/dia echo $PATH gives /home/gottlieb/bin/:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2:/usr/games/bin which dia gives /home/gottlieb/bin/dia `which dia` correctly starts dia in integrated (one window) mode /home/gottlieb/bin/dia correctly starts in integrated mode /usr/bin/dia correctly starts dia in the default (two window) mode BUT plain dia incorrectly starts dia in the default mode. You might need to run hash -r in your current shell. Bingo! And it works fine in new shells. Thank you. If that doesn't help then ensure that there is no alias. There were no aliases. Incidentally, I would suggest that you write this in your script: exec /usr/bin/dia --integrated Done. Thanks again. allan
Re: [gentoo-user] trouble overriding a command name
On Thu, Aug 28 2014, Canek Peláez Valdés wrote: On Thu, Aug 28, 2014 at 10:42 AM, gottl...@nyu.edu wrote: I know this is trivial and apologize in advance for what must be a simple (non-gentoo) error on my part. In /home/gottlieb/bin/dia I have the following #!/bin/bash /usr/bin/dia --integrated ls -l /home/gottlieb/bin/dia gives -rwxr-xr-x 1 gottlieb gottlieb 38 Aug 28 11:28 /home/gottlieb/bin/dia echo $PATH gives /home/gottlieb/bin/:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2:/usr/games/bin which dia gives /home/gottlieb/bin/dia `which dia` correctly starts dia in integrated (one window) mode /home/gottlieb/bin/dia correctly starts in integrated mode /usr/bin/dia correctly starts dia in the default (two window) mode BUT plain dia incorrectly starts dia in the default mode. What am I missing? What's the output of alias? What happens if you execute dia, in quotes? No relevant aliases. The old shell is gone and new shells work so can't test in original state. dia works fine. As Kerin stated, the problem was that I needed to run hash -r in the old shell (or start a new one). Thanks, allan