Hi

Version:
From Debian SID

> bash --version
GNU bash, version 3.00.16(1)-release (i386-pc-linux-gnu)


As it seems it is not possible to append multiple command to the "history", only replace the last command.

I also tried to import a "dummy"-history before each "history -s" (to have "dummy" replaced), but "history -n <dummy-file_containing_a_single_dummy_entry_NOT_already_present_in_history> ", but the "history -n" did nothing.



Background:
Since about half-year/year it is possible in "konsole"s from KDE to read out the name of the session. So i named all my konsole-sessions and saved the whole KDE-session, so that i get a ton of konsoles when KDE starts.

With the following in "$HOME/.profile":
- snip -
NAME=""
if [ "$KONSOLE_DCOP_SESSION" != "" ]; then
  KON=`echo $KONSOLE_DCOP_SESSION | cut -d \( -f2 | cut -d , -f1`
  if [ "$KON" != "" ]; then
    SES=`echo $KONSOLE_DCOP_SESSION | cut -d , -f2 | cut -d \) -f1`
    if [ "$SES" != "" ]; then
      NAME=`dcop $KON $SES sessionName`
    fi
  fi
fi
- snip -
i get the name of the session and with that name i can do a
- snip -
case "$NAME" in
        "whatever")
        do something
        ;;
        "something else")
        do another thing
        ;;
...
...
...
esac
- snip -
to create a matching "environment" for the things i want to do with a given session.

As the history-handling doesn't really work if you have dozens of bashes i switched of history-saving and created a "default" history that is used for all session.

The problem is now that i can exchange the last command with a "custom" one via "history -s", but what i miss is to append e.g. 3 custom commands to the history of a session.




Bis denn

--
Real Programmers consider "what you see is what you get" to be just as
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated,
cryptic, powerful, unforgiving, dangerous.



_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to