Delete entry from ash editing history buffer

Walter Dnes waltdnes at waltdnes.org
Tue Mar 6 04:52:19 UTC 2012


On Mon, Mar 05, 2012 at 04:46:56PM +0100, Alexander Kriegisch wrote
> Is there any way to programmatically remove one/several/all entries from
> ash's command line history? I am in a situation in which I need to feed
> a command into a subshell, but do not want this command to appear in the
> history. In bash I can use "HISTCONTROL=ignorespace" and just precede
> the command by a single space, but I have no idea how to manipulate the
> history in ash.

  Is the command different every time, or is it the same every time
(e.g. logging in somewhere)?  If the command is constant
* save it as a text file.
* chmod 400 <filename>
* and then "source filename" when you need it.

  History will contain "source filename", which won't be that helpful.
The way "source" and "." work, you do not need to mark the text file
executable.  With permission 400, only the owner and root can read the
contents of the file.

-- 
Walter Dnes <waltdnes at waltdnes.org>


More information about the busybox mailing list