recentpopularlog in

kme : frustration   4

Preserve bash history in multiple terminal windows - Unix & Linux Stack Exchange
True dat:
@Oli wrote, "I can't think of an intelligent way to do it where existing terminals only see their own history but new ones see a chronologically accurate list of commands." How about (untried): export PROMPT_COMMAND="history -a; $PROMPT_COMMAND". Existing shells will add each command to the history file for new shells to see, but only show their own histories.


Many solutions proposed, all with caveats, but this is what I decided on:

<code class="language-bash">
HISTCONTROL=ignoredups:erasedups # no duplicate entries
HISTSIZE=100000 # big big history
HISTFILESIZE=100000 # big big history
shopt -s histappend # append to history, don't overwrite

# append current history list to the history file after each command finishes
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }history -a"</code>

This appends lines to the history file after each command, which makes them available in other sessions, but up arrow will still reverse through the history only for the current session, which is probably less confusing.

You can bring in commands from other sessions (which have been written to the history file) with 'history -n'. Depending on the setting of 'HISTCONTROL', these might end up getting written out to the history file again, though. ¯\_(ツ)_/¯
bash  history  histfile  historyexpansion  frustration  configfile  forthecomments  solution 
july 2019 by kme
How to share/export a global variable between two different perl scripts? - Stack Overflow
The usual way this is resolved in Perl is to create modules, and then import from those modules. In this case:

#!/usr/bin/perl

package My::Module; # saved as My/Module.pm
use strict;
use warnings;

use Exporter;
our @ISA = 'Exporter';
our @EXPORT = qw(@a @b);

our (@a, @b);

@a = 1..3;
@b = "a".."c";
perl  module  frustration  dammitbrain  solution 
december 2016 by kme
javascript - Why does Firefox forget value of variable? Solution for debugging? - Stack Overflow
So Firefox warns you "Error: variable has been optimized out," but Chrome just fails silently.
javascript  optimization  frustration  newbie  chrome  firefox  solution 
august 2014 by kme
Manually synching one app: Apple Support Communities
Oh, the frustration of living inside Apple's walled garden.
itunes  ipod  apple  app  synchronization  frustration 
january 2014 by kme

Copy this bookmark:





to read