[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

bash guru wanted



When I try to view a pgm-file with gqview, I always
get a core-dump (Segmentation violation). This is
reproducable on two machines here - but only for pgm.
The picture shows up very shortly before the crash.

Example:
  gqview /usr/share/gimp/1.2/gimpressionist/Brushes/shape02.pgm

Is this reproducable elsewhere or is this something special to me?

Thanx, Michael


A friend of mine told me about a bash-feature, I do not find mentioned
in "man bash".
The feature is the "\$(command)" construct in the promptstring (PS1).
I tried to exploit this feature to achieve a long-time wish.
I want my bash to obey eof (^D) only if there are no jobs in the background.
So I tried to "set -o ignoreeof" from within above construct. But to no luck.
The same holds for "IGNOREEOF=999".
My experiments show, that "\$(...) does work, but my impression is, that
PS1 is evaluated in a kind of sandbox. I can oly influence how the prompt
looks like, without any sideeffects otherwise.

Example:
  PS1="\s-\v\$ \$(jobcount)"
  jobcount()
  {
    if [ ! -z "`jobs -p`" ] ; then
      echo "Background jobs running"                  # I see this
      set -o ignoreeof                                             # THIS HAS NO EFFECT
    fi
  }

Well, I get the message "There are stopped jobs." if I hit ^D, but
only once. The second ^D will end my bash. This is not what I want.
BTW: I do not get above message, if the background job is active.

So my question:
Does anybody know how to setup bash, so that eof is only obeyed if there
is no background job (be it stopped or running)?

Thanx, Michael





Reply to: