Discussion:
bash trouble ??profile
(too old to reply)
Randall R Schulz
2010-12-29 20:52:49 UTC
Permalink
Try launching an interactive shell (in misbehaving mode) with the
"-x" option. You can see exactly what it's executing right up to
(and possibly beyond) the "have" diagnostic.
Aha, I see a lot and have appears quite frequently. But there are
4500+ lines of output :^(, how do I caputre them all?
bash -x >> bash.log
bash -x | tee > bash.log
bash -x | tee -ia > bash.log
do not work....
tks,
Yeah, it's voluminous. Shows you how much is really going on in the
shell!

If you expressly invoke it as an interactive shell and redirect standard
error, you can capture the execution trace:

outer-shell-prompt> bash -i 2>/tmp/bash-start-log
exit
outer-shell-prompt>

(Note that the sub-shell, while interactive, will show no prompt 'cause
it uses the same stream as the error stream to print prompts.)

You can optionally include --login along with -i. The distinction
between the two may actually tell you something about what's going
wrong. For whatever reason, if you give both --login and -i, they have
to be in that order.
--
Patrick Shanahan
Randall Schulz
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Patrick Shanahan
2010-12-29 21:23:05 UTC
Permalink
Post by Randall R Schulz
Yeah, it's voluminous. Shows you how much is really going on in the
shell!
If you expressly invoke it as an interactive shell and redirect standard
outer-shell-prompt> bash -i 2>/tmp/bash-start-log
exit
outer-shell-prompt>
(Note that the sub-shell, while interactive, will show no prompt 'cause
it uses the same stream as the error stream to print prompts.)
the output from: prompt> bash -i -x 2> bash-start.log
is at: http://wahoo.no-ip.org/~pat/bash-start.log

an strace of "bash -x" is here:
http://wahoo.no-ip.org/~pat/bash.log

invoking with the --login parameter gave slightly longer output but I
fail to see anything in any of the files :^(

tks for the assistance.


ps: Would it be better if I made a new user with no profile/bashrc
except /etc/bash.bashrc and ran the interactive capture?
--
Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711
http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535 @ http://counter.li.org
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Randall R Schulz
2010-12-29 21:34:16 UTC
Permalink
Post by Patrick Shanahan
...
the output from: prompt> bash -i -x 2> bash-start.log
is at: http://wahoo.no-ip.org/~pat/bash-start.log
The "have: command not found" diagnostic occurs immediately after
source-ing /etc/bash_completion.d/patool.sh. What's in that file on
your system?
Post by Patrick Shanahan
http://wahoo.no-ip.org/~pat/bash.log
It seems fairly clear that the "have" invocation (attempt) originates
in /etc/bash_completion.d/patool.sh.
Post by Patrick Shanahan
invoking with the --login parameter gave slightly longer output but I
fail to see anything in any of the files :^(
tks for the assistance.
ps: Would it be better if I made a new user with no profile/bashrc
except /etc/bash.bashrc and ran the interactive capture?
Perhaps that would show less stuff to confound analysis, but since this
is happening for all current users, it's not obvious that it would
supply a meaningful data point.
Post by Patrick Shanahan
--
Patrick Shanahan
Randall Schulz
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Patrick Shanahan
2010-12-29 21:41:41 UTC
Permalink
Post by Patrick Shanahan
the output from: prompt> bash -i -x 2> bash-start.log
is at: http://wahoo.no-ip.org/~pat/bash-start.log
http://wahoo.no-ip.org/~pat/bash.log
invoking with the --login parameter gave slightly longer output but I
fail to see anything in any of the files :^(
tks for the assistance.
ps: Would it be better if I made a new user with no profile/bashrc
except /etc/bash.bashrc and ran the interactive capture?
I may have found it:

+ for s in '/etc/bash_completion.d/*.sh'
+ test -r /etc/bash_completion.d/patool.sh
+ . /etc/bash_completion.d/patool.sh
++ have patool
bash: have: command not found

but I don't understand the problem:
***@wahoo:~> rpm -qf /usr/share/doc/packages/patool
patool-0.12-2.1.noarch
***@wahoo:~> which patool
/usr/bin/patool

doing: zypper in -f patool

that didn't do it, doing:
zypper in -f bash-completion

no-go there either :^(

suggestions?

tks
--
Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711
http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535 @ http://counter.li.org
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Patrick Shanahan
2010-12-29 21:45:13 UTC
Permalink
Post by Randall R Schulz
The "have: command not found" diagnostic occurs immediately after
source-ing /etc/bash_completion.d/patool.sh. What's in that file on
your system?
I reinstalled both bash-completion and patool w/o any relief.

here is /etc/bash_completion.d/patool.sh

# patool completion
#
have patool &&
{
_patool()
{
local cur prev commands options command

COMPREPLY=()
cur=`_get_cword`

commands='extract list test create diff repack formats'

if [[ $COMP_CWORD -eq 1 ]] ; then
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help' -- $cur ) )
else
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
fi
else

command=${COMP_WORDS[1]}

if [[ "$cur" == -* ]]; then
# possible options for the command
options=''
case $command in
extract|list|test|create)
options='--verbose'
;;
esac
options="$options --help"

COMPREPLY=( $( compgen -W "$options" -- $cur ) )
else
_filedir
fi
fi

return 0
}
complete -F _patool $filenames patool

}



I just understand enough to get into trouble :^)
tks
--
Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711
http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535 @ http://counter.li.org
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Patrick Shanahan
2010-12-29 19:06:33 UTC
Permalink
available to view: http://wahoo.no-ip.org/~pat/bash.bashrc
The word "have" occurs only once there and it's in a comment.
Did you verify that your system's /etc/bash.bashrc file is not corrupt?
yes, and diffed against the earlier version. No diff!
--
Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711
http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535 @ http://counter.li.org
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Patrick Shanahan
2010-12-29 20:22:21 UTC
Permalink
Try launching an interactive shell (in misbehaving mode) with the "-x"
option. You can see exactly what it's executing right up to (and
possibly beyond) the "have" diagnostic.
Aha, I see a lot and have appears quite frequently. But there are 4500+
lines of output :^(, how do I caputre them all?
bash -x >> bash.log
bash -x | tee > bash.log
bash -x | tee -ia > bash.log
do not work....

tks,
--
Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711
http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535 @ http://counter.li.org
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Randall R Schulz
2010-12-30 14:11:56 UTC
Permalink
a possible solution, removal of the script,
/etc/bash_completion.d/patool.sh
Indeed, removal of the file, /etc/bash_completion.d/patool.sh
*solves* the problem of the delay and error msg "bash: have: command
not found"
Of course, but only at the expense of the completions for patool
that .../patool.sh would have established.
AND, I guess, a report to bugzilla??
But I still don't understand why I have the problem and others do
not??
nor which package, bash-completion or patool, is causing the problem.
The peculiar thing is that in the execution trace (from the -x option to
bash) shows the pattern of setting and unsetting the _value_ "have"
(unset -v have ... have="yes") and finally the unsetting of the
function defintion have() (unset -f have). It is following this last
unset that the patools script is sourced and that is why the diagnostic
occurs (and, of course, the code that is predicated on the exit /
return status of have() does not run and the patools completions are
not established).

The other possible clue is that the amount of trace between the many
iterations of the { unset -v have ... have="yes" } cycle is much
smaller (on the order of 10) than that between the { unset -f have }
and the diagnostic for "have: command not found" (nearly 300),
suggesting that the patools completion set-up script is being executed
in the wrong place.
But I will make a bug report to bugzilla.novell.com against
bash-completion and cite patool package
Bug #661851 submitted.
--
Patrick Shanahan
Randall Schulz
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Patrick Shanahan
2010-12-30 13:23:28 UTC
Permalink
Post by Patrick Shanahan
Post by Randall R Schulz
The "have: command not found" diagnostic occurs immediately after
source-ing /etc/bash_completion.d/patool.sh. What's in that file on
your system?
I reinstalled both bash-completion and patool w/o any relief.
here is /etc/bash_completion.d/patool.sh
# patool completion
#
have patool &&
{
Your next test upon finding this code here is to locate the command
called "have"
"which have"
"type have"
"whereis have"
will probably return nothing, ie, "have" is neither a shell builtin,
nor a defined alias, nor is there an executable in your $PATH named
"have".
Either find some package that installs a program called "have" or
find some .rc script that is supposed to define an alias named
"have", or fix the garbage script here that assumes all boxes have a
command or alias named "have".
in *this* case, have is a function provided by /etc/bash_completion:

# This function checks whether we have a given program on the system.
# No need for bulky functions in memory if we don't.
#
have()
{
unset -v have
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null &&
have="yes"
}


which calls a ?subscript? in /etc/bash_completion.d/patool.sh
that was quoted, re: your explanation of "have/which".
In fact, in this script, it appears "have" is supposed to do
something like "which", "type", or "whereis" do.
You can just replace the word "have" above with the word "which".
Possibly this script was written for some other (non-suse)
distribution that happens to define a "have" alias or function in
it's shell rc scripts. Possibly on that distro, the "have" command
does more than just look for the argument in $PATH like consult the
package database maybe. But for you, for now, just try using "which",
and only get fancier if it turns out to be necessary.
Or look for a correct opensuse package for patool which doesn't try
to use commands that don't exist on opensuse.
08:17 wahoo:~ > rpm -q bash-completion patool
bash-completion-1.1-6.1.noarch
patool-0.12-2.1.noarch

which were obtained from:
http://download.opensuse.org/repositories/shells/openSUSE_11.2/
http://download.opensuse.org/repositories/Archiving/openSUSE_11.2/


a possible solution, removal of the script,
/etc/bash_completions.d/patool.sh

AND, I guess, a report to bugzilla??
But I still don't understand why I have the problem and others do not??
--
Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711
http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535 @ http://counter.li.org
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Patrick Shanahan
2010-12-30 13:47:41 UTC
Permalink
a possible solution, removal of the script,
/etc/bash_completion.d/patool.sh
Indeed, removal of the file, /etc/bash_completion.d/patool.sh *solves*
the problem of the delay and error msg "bash: have: command not found"
AND, I guess, a report to bugzilla??
But I still don't understand why I have the problem and others do not??
nor which package, bash-completion or patool, is causing the problem.

But I will make a bug report to bugzilla.novell.com against
bash-completion and cite patool package

Bug #661851 submitted.
--
Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711
http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535 @ http://counter.li.org
--
To unsubscribe, e-mail: opensuse+***@opensuse.org
For additional commands, e-mail: opensuse+***@opensuse.org
Loading...