bug-bash
[Top][All Lists]
Advanced

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

Feature-Request: Append command to history


From: Matthias Schniedermeyer
Subject: Feature-Request: Append command to history
Date: Sat, 11 Jun 2005 17:58:47 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217 Mnenhy/0.7

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]