Sponsored Content
Full Discussion: Shopt -s histappend
Top Forums UNIX for Advanced & Expert Users Shopt -s histappend Post 303037091 by apmcd47 on Tuesday 23rd of July 2019 06:30:56 AM
Old 07-23-2019
So adding
Code:
shopt -s histappend
PROMPT_COMMAND='history -a'

in your .bashrc will mimic the behaviour of ksh in that it writes all commands to its history file as (after?) it executes them.

Presumably the correct order of history -a and history -n would allow two or more shells to share their history, exactly like ksh (my least favourite feature of ksh)

Andrew
 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shopt -s nullglob

Hi, I am using BASH. In a directory there are files that match either of the following 2 patterns: *.L1A_AC* or S*.L1A_MLAC* I would like to write a script that will include a for loop, where for each file in the directory, a certain function will be performed. For example: for FILE in... (4 Replies)
Discussion started by: msb65
4 Replies

2. Shell Programming and Scripting

Bash 'shopt' doubt

Hi, I am using bash shell's extended pattern matching. What tweak the following code needs in order to get the expected output? shopt -s extglob f="a@b@_c@d@_e" echo "${f/@(@|@_)/__}" My expected output is: a__b__c__d__e but the actual output is: a__b@_c@d@_e # that is, how to... (3 Replies)
Discussion started by: royalibrahim
3 Replies
history(n)					       Provides a history for Entry widgets						history(n)

__________________________________________________________________________________________________________________________________________________

NAME
history - Provides a history for Entry widgets SYNOPSIS
package require Tcl 8.4 package require Tk 8.4 package require history ?0.1? ::history::init pathName ?length? ::history::remove pathName ::history::add pathName text ::history::get pathName ::history::clear pathName ::history::configure pathName option ?value? bell _________________________________________________________________ DESCRIPTION
This package provides a convenient history mechanism for Entry widgets. The history may be accessed with the up and down arrow keys. ::history::init pathName ?length? Arranges to remember the history of the named Entry widget. An optional length determines the number of history entries to keep. This may be changed later with ::history::configure. History entries must be added with the ::history::add command before they can be seen. ::history::remove pathName Forgets all history entries for the Entry pathName and removes the history bindings. ::history::add pathName text This command is used to add history entries to an Entry that has previously had ::history::init called on it. This command should be called from your Entry handler with the contents of the entry (or whatever you wish to add to the history). ::history::get pathName This command returns a list containing the history entries for the Entry pathName ::history::clear pathName This command clears the history list for the named Entry. ::history::configure pathName option ?value? This command queries or sets configuration options. Currently the options recognized are length and alert. Setting the length deter- mines the number of history entries to keep for the named Entry. Alert specifies the command to run when the user reaches the end of the history, it defaults to bell entry .e bind .e <Return> [list ProcessEntry %W] ::history::init .e pack .e proc ProcessEntry {w} { set text [$w get] if {$text == ""} { return } ::history::add $w $text puts $text $w delete 0 end } KEYWORDS
entry, history history 0.1 history(n)
All times are GMT -4. The time now is 09:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy