Sponsored Content
Full Discussion: Shopt -s histappend
Top Forums UNIX for Advanced & Expert Users Shopt -s histappend Post 303037022 by Neo on Sunday 21st of July 2019 01:22:54 AM
Old 07-21-2019
I am not 100% sure, but I "think" it is there for some legacy backward compatibility issue.

On my systems, the history is always appended even when histappend is set to off.

For example, on macOS:

Code:
Tim$ shopt
cdable_vars    	off
cdspell        	off
checkhash      	off
checkwinsize   	on
cmdhist        	on
compat31       	off
dotglob        	off
execfail       	off
expand_aliases 	on
extdebug       	off
extglob        	off
extquote       	on
failglob       	off
force_fignore  	on
gnu_errfmt     	off
histappend     	off
histreedit     	off
histverify     	off
hostcomplete   	on
huponexit      	off
interactive_comments	on
lithist        	off
login_shell    	on
mailwarn       	off
no_empty_cmd_completion	off
nocaseglob     	off
nocasematch    	off
nullglob       	off
progcomp       	on
promptvars     	on
restricted_shell	off
shift_verbose  	off
sourcepath     	on
xpg_echo       	off

Linux:

Code:
# shopt
autocd         	off
cdable_vars    	off
cdspell        	off
checkhash      	off
checkjobs      	off
checkwinsize   	on
cmdhist        	on
compat31       	off
compat32       	off
compat40       	off
compat41       	off
compat42       	off
compat43       	off
complete_fullquote	on
direxpand      	off
dirspell       	off
dotglob        	off
execfail       	off
expand_aliases 	on
extdebug       	off
extglob        	on
extquote       	on
failglob       	off
force_fignore  	on
globasciiranges	off
globstar       	off
gnu_errfmt     	off
histappend     	off
histreedit     	off
histverify     	off
hostcomplete   	off
huponexit      	off
inherit_errexit	off
interactive_comments	on
lastpipe       	off
lithist        	off
login_shell    	on
mailwarn       	off
no_empty_cmd_completion	off
nocaseglob     	off
nocasematch    	off
nullglob       	off
progcomp       	on
promptvars     	on
restricted_shell	off
shift_verbose  	off
sourcepath     	on
xpg_echo       	off

In both example cases above, the history is appended and not overwritten even though it is shown to be "off".
 

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
PRUNEHISTORY(8) 					    InterNetNews Documentation						   PRUNEHISTORY(8)

NAME
prunehistory - Remove tokens from Usenet history file SYNOPSIS
prunehistory [-p] [-f filename] DESCRIPTION
prunehistory modifies a history(5)-format text file to "remove" a set of tokens from it. The tokens are removed by overwriting them with spaces, so that the size and position of any following entries does not change. This has an effect similar to expiring the article, in that it is still mentioned in the history database but cannot be retrieved. prunehistory reads the standard input. The input is taken as a set of lines. Blank lines and lines starting with a number sign ("#") are ignored. All other lines should consist of a message-ID followed by zero or more other fields (which are ignored). The message-ID is used as the dbz(3) key to get an offset into the text file. Since innd only appends to the text file, prunehistory does not need to have any interaction with it. OPTIONS
-p prunehistory will normally complain about lines that do not follow the correct format. If the -p flag is used, then the program will silently print any invalid lines on its standard output. (Blank lines and comment lines are also passed through.) This can be useful when prunehistory is used as a filter for other programs such as reap (a legacy program, probably no longer useful with current versions of INN, but still available at <ftp://ftp.ruhr-uni-bochum.de/.subdisc1/local/jk.collection/>). -f filename The default name of the history file is pathdb/history; to specify a different name, use the -f flag. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. Converted to POD by Julien Elie. $Id: prunehistory.pod 8592 2009-08-20 23:46:25Z eagle $ SEE ALSO
dbz(3), history(5), innd(8). INN 2.5.2 2009-09-11 PRUNEHISTORY(8)
All times are GMT -4. The time now is 09:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy