From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_HOTMAIL_RCVD2, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id D63EA22BBA for ; Sun, 11 Feb 2024 10:34:18 +0100 (CET) ARC-Seal: i=2; cv=pass; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1707644058; b=i2lxU0zKOtOWEn8/euw/uqQVQWO6K5zyARYLYSGquEuyyLzMQ8/9ZdMIv9iCriduwUJd+J0qDI f3IIviwoJqpePCuBSoiinkibtiQ/OL5mHpvr9yFlQ6SHO5Uj6Wq8ryGKlcWAe2TsWO0J8hqJZh V0tvwyJ7fSKuNVgf6Wnol7m9yVLgAHz5Jml4Pn0pubvOUb/AQmRzbaEPl4QKFwNOl0/8fuVCZk P+QqxNVojXwviwvGhLDPXccBRfpsS3hNDajc4EbPa2DPgxtE24XyVht/JBeDvuwJ5QHv6CrUEb xutKEedcyzM52kiwm1dXUfPyQ17rGkfKja2lOvdABLaIeQ==; ARC-Authentication-Results: i=2; zsh.org; iprev=pass (mail-co1nam11olkn2055.outbound.protection.outlook.com) smtp.remote-ip=40.92.18.55; dkim=pass header.d=hotmail.com header.s=selector1 header.a=rsa-sha256; dmarc=pass header.from=hotmail.com; arc=pass (i=1) header.s=arcselector9901 arc.oldest-pass=1 smtp.remote-ip=40.92.18.55 ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1707644058; bh=gPu2Q3WbbFt4+nr1FQQoCH3ZfZu26cL58oQMSEUr52Y=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:MIME-Version:In-Reply-To:Cc:From:References:To:Subject:Date: Message-ID:Content-Type:DKIM-Signature:DKIM-Signature; b=hPQA3A47Ie9fLFlYokTLmoBFAGLY+xJzg01Mte/A25abYQkFJxcqELN5xSpVm/HYnxPmqcrrw7 X/T8Yibkfqw+Q2yKcf3I7Ew48mbf5bM3ZuaeqjClvWFxQJN67jNL2F41vYoZ6ygQ+CMSHvDuue gSHOBBwq5enAFWMtWuVLrsbcOEaGVSnn7HuvPuksG7RAytGtUYVDcfRg94KMTEPno8SoHLoVT3 HAf/TBF4FXTIIxiPAj93QV2zztYp/HTK/4rNHa6NEFlkvq6P+QYQOGAvqMyn6HwLcEET4TKa4N B7AVcqh+TyaJ41xdk4D2P0YfA9O42KpIxOVV5fq4s5tdyQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:MIME-Version:In-Reply-To:Cc:From: References:To:Subject:Date:Message-ID:Content-Type:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=iwyIGdStsbSZduW9+Tagj2rIusCW11fRw53ny7Gi/oA=; b=L/ibnVzvM2j/c8E/jcyvCZU3vI TUT5AzIIOwvc8F33sLvTRXM152IAfBeriZN5Xq2+jGvUH3H4Xs7IiM3/61ViQxbEUDQvo7rvZhsOo 4TurlOgIcwHyIDxiu9V6VbNEiNdxvKf9iwXvPxthVHFxfP/FVw+Zojo3yzxgN8rq2E0Dpkb4ddzt/ /OE0hzgt7qHb9DfyorO5E/KAjMhqxA6QBn4zR3Gkw7SokjyILX/QAd/eNDIcXUGSutP33ghRSei3r SPHZzQyJLHjh8aB1AiYwEYBN+FlvFDB0Vl9ePutD3M2oQqEdWfa2nFWPYsakU18a1akuSJjuexrD8 SQU/gXAA==; Received: by zero.zsh.org with local id 1rZ6E4-000IZX-JF; Sun, 11 Feb 2024 09:34:16 +0000 Authentication-Results: zsh.org; iprev=pass (mail-co1nam11olkn2055.outbound.protection.outlook.com) smtp.remote-ip=40.92.18.55; dkim=pass header.d=hotmail.com header.s=selector1 header.a=rsa-sha256; dmarc=pass header.from=hotmail.com; arc=pass (i=1) header.s=arcselector9901 arc.oldest-pass=1 smtp.remote-ip=40.92.18.55 Received: from mail-co1nam11olkn2055.outbound.protection.outlook.com ([40.92.18.55]:24609 helo=NAM11-CO1-obe.outbound.protection.outlook.com) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1rZ6DQ-000Hus-Ir; Sun, 11 Feb 2024 09:33:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nZRxViJLiYQ843Kv2Qz8wQ8OjbIOxzbdrkVWPIHG/iHKFwu1Ol+15kMC3dqfh9C10BpzS+MUhm0QKnt/0nV74vylUxiEOuEfHLDUzQUUXvxsK6+6hOE1ZiJfOTWb1g2y5aIH0d+Jfo0OS/u6pL5iMWf+X0eXEB0CE6NAiXsGkU0u+HR4beVsZnAK7TmZfHVE0AX49DG47Zbv1ixqMz2ZUB9eudYQyhXEN+7iKtyJBO65EmzKjoRozmjO+kFy3c5C0x629bO97IE6/zGgeOygDLPKOXaSd3CZaYf4N/H0bcSuP/LXTU3lhKynXzs/N7SdrGxQQW7Dp7mMVvD+uICAUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iwyIGdStsbSZduW9+Tagj2rIusCW11fRw53ny7Gi/oA=; b=B3obiqSfmVh8lAYRL1uMt2xZLvX5NtE+Nxp3/K3ixg3yB+b6ZBchs/EnXGzMAAv3vy0Yd3DJFwuO6F+8x/B2tiMZ/yOS6xLWL7LzJCbdlWuA4FOEKV8eFxdOdLXID3O0wRGzftebgsgd0ngFXJxPljWBTDuORVcHMO+m+934ZWgN78QXoU0fkyg8CqWiRCKIv11DTBm2cOhGS/iAzSiyU/k+YLVxh2HgO9zK3DAyflQmmwoRBS08D/YcR+kZ6prCsJBpaqB4OZ4FINb8HznBifCb/Lai28uGWK+yY/xzh4z/soz4TtAaqJEdcsy2XVnEiLcUHVNggdejpv9kD79+yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iwyIGdStsbSZduW9+Tagj2rIusCW11fRw53ny7Gi/oA=; b=dzhKHzCWjWGNwGk/K7nPWSm9YDE3MAo+6EoiR2SXvXG4jlHrHBWvOpSCnkpetmCEo5bISUjxRQd0HstHGHxkiYwaRgf6jgm53JLCcEWvcWKOcJwKO3LPjbGsmVZvw9k1/T0hG+zJSblVux3o/CHNIel8RJg3zZr4zMJ+KcV8neQJ7AAHQeNbQ5XlfZ507Zq1hXS1pB5QoRSzj3d7kiDBzA5paRmJMMbk1/BDJB/C85VYeenfd9DKurU5r1K+WKp2kd21ksEwFXlAd5k+dYbIKpNTGXn8nUJMdoGcYFCFAaqZQVCvohbS1evQKVntSlAWEWvrY4yeSyufT0bkEOHLIQ== Received: from SCYPR80MB7048.lamprd80.prod.outlook.com (2603:10d6:300:47::10) by SC3PR80MB9130.lamprd80.prod.outlook.com (2603:10d6:300:13c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.35; Sun, 11 Feb 2024 09:33:29 +0000 Received: from SCYPR80MB7048.lamprd80.prod.outlook.com ([fe80::7e90:1106:2c66:f57b]) by SCYPR80MB7048.lamprd80.prod.outlook.com ([fe80::7e90:1106:2c66:f57b%5]) with mapi id 15.20.7270.033; Sun, 11 Feb 2024 09:33:29 +0000 Content-Type: multipart/alternative; boundary="------------w0rZkc7c2jmjPhH1VhbLrRTC" Message-ID: Date: Sun, 11 Feb 2024 06:33:38 -0300 User-Agent: Mozilla Thunderbird Subject: Re: About de-duplicating the history and history appending To: zsh-users@zsh.org References: Content-Language: en-US From: Max Blue Cc: Bart Schaefer In-Reply-To: X-TMN: [1FnfCejJ24p4RAnXxmhdQC92HNL9pRh1TfxYrgvIyA0=] X-ClientProxiedBy: CP3P284CA0013.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:6c::18) To SCYPR80MB7048.lamprd80.prod.outlook.com (2603:10d6:300:47::10) X-Microsoft-Original-Message-ID: <4ff4bda0-b28b-4ec6-b5c5-afc912e5ecab@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SCYPR80MB7048:EE_|SC3PR80MB9130:EE_ X-MS-Office365-Filtering-Correlation-Id: 7811de0c-4134-4b4e-b665-08dc2ae480c8 X-MS-Exchange-SLBlob-MailProps: B8gWPGiJ24QFPA1th5pTIIXmQdRZuqhtGVKV3dDTF4gxcZZhWqQhf/o2+0F+eC1ux4JC2way4ZNNFFyDF6utIGgBPZ5tpjd4tGD2ngKnZ98BiNy4SFg5ONnwwuz5YkkX2xmRDUT9lQWGakWRN/zS7gvNRij5uU8RZfuhV67ZjRSuz9GZaRgK8yE6mr/scfo5ZKVj8iYFd8Cd5pLZbKof7c2Z1fR5XSAy+YZqwMHvkE/zItm5CE+kuSVuN/HklW+WPASGvV3C2dP50tQuL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.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 7811de0c-4134-4b4e-b665-08dc2ae480c8 X-MS-Exchange-CrossTenant-AuthSource: SCYPR80MB7048.lamprd80.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2024 09:33:28.2885 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SC3PR80MB9130 X-Seq: 29658 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --------------w0rZkc7c2jmjPhH1VhbLrRTC Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello. Thanks Larry for the clear explanation, this things are hard for me to explain. These are fundamentally incompatible goals. Bash and zsh will not cooperate with each other for purposes of (avoiding) overlapping writes, the timestamp formats are incompatible, and the zsh history is stored "metafied" -- it is not a plain text file. That also explains this: >> that after running this script, some special characters becomes 'weird' >> into the *.bash_history *viewing. With weird i mean things like *#º >> *and* #º *,which fortunately are not present in the terminal history >> (the commands are properly shown in there). About the timestamps, i do not use those, so i think that would not be a problem. I have seen, when the trying some options which broke the history file (truncated it somehow), that there was some kind of timestamp in the 2 last commands, but they are not present in the .bash_history now. I think that the timestamp is disabled on my side, and that's why i do not see it. It makes sense to me now that sharing the history file for both shells does not make sense and that would be causing those 'funny' characters into the /.bash_history/ file. Those ones, on the other hand, display correctly in the zsh shell, when looking through the history. Besides that, should i expect any other kind of trouble if continuing like this? i have been a while in bash and almost all my history lines are written that way. HIST_EXPIRE_DUPS_FIRST I think this one is not what i want, this will 'prune' the history when some kind of limit on the history lines is reached. I just want to keep my history file as clean as possible, but i also keep it long( /HISTSIZE=2000000/ , because i do not want to lose lines). My approach to this would be to use "fc -p" to point to a new history file with setopts as appropriate from the above, pull the HISTFILE into that with "fc -R", write it out again with "fc -W", then move that to the desired history file with appropriate locking (which you can probably do by calling "fc -P" to switch back to the original history and then cycling -R/-W again). If you write that as a zsh script you can invoke it from bash to clean up bash's history as well, with the timestamp caveat. I'm not at my usual computer right now so not going to test details, I'll chime in again later if things seem to be going awry. I do not understand how implement this, and what would be the difference about the previous idea of the /trap/ command. I will appreciate if you can elaborate about this when you can. Bluey. --------------w0rZkc7c2jmjPhH1VhbLrRTC Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hello.

Thanks Larry for the clear explanation, this things are hard for me to explain.


These are fundamentally incompatible goals.  Bash and zsh will not
cooperate with each other for purposes of (avoiding) overlapping
writes, the timestamp formats are incompatible, and the zsh history is
stored "metafied" -- it is not a plain text file.  That also explains
this:

that after running this script, some special characters becomes 'weird'
into the *.bash_history *viewing. With weird i mean things like *#º
*and* #º *,which fortunately are not present in the terminal history
(the commands are properly shown in there).

About the timestamps, i do not use those, so i think that would not be a problem. I have seen, when the trying some options which broke the history file (truncated it somehow), that there was some kind of timestamp in the 2 last commands, but they are not present in the .bash_history now. I think that the timestamp is disabled on my side, and that's why i do not see it.

It makes sense to me now that sharing the history file for both shells does not make sense and that would be causing those 'funny' characters into the .bash_history file. Those ones, on the other hand, display correctly in the zsh shell, when looking through the history. Besides that, should i expect any other kind of trouble if continuing like this? i have been a while in bash and almost all my history lines are written that way.


HIST_EXPIRE_DUPS_FIRST

I think this one is not what i want, this will 'prune' the history when some kind of limit on the history lines is reached. I just want to keep my history file as clean as possible, but i also keep it long( HISTSIZE=2000000 , because i do not want to lose lines).

My approach to this would be to use "fc -p" to point to a new history
file with setopts as appropriate from the above, pull the HISTFILE
into that with "fc -R", write it out again with "fc -W", then move
that to the desired history file with appropriate locking (which you
can probably do by calling "fc -P" to switch back to the original
history and then cycling -R/-W again).

If you write that as a zsh script you can invoke it from bash to clean
up bash's history as well, with the timestamp caveat.  I'm not at my
usual computer right now so not going to test details, I'll chime in
again later if things seem to be going awry.


I do not understand how implement this, and what would be the difference about the previous idea of the trap command. I will appreciate if you can elaborate about this when you can.


Bluey.

--------------w0rZkc7c2jmjPhH1VhbLrRTC--