From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10175 invoked from network); 26 Jan 2023 16:57:24 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Jan 2023 16:57:24 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1674752244; b=PPecKOFGxYi9UViUVPaUYgjB8uq9hCR7Kmk73oq1UMtMBnMli+M3NG+/D5YIUsN1n1CuHyjD9P Ty8iF1+GZyXGXXzxqDEB6bPHMvlqlihDXY1BB09PQvnOGrVSocUdMoAUR35/6QkHzA9NaMWoH3 FrWJKGbYO4SbZsPOHs8Pdej0o4NqHCik9yzetM44pLI1EriMeErexfXTBD6ikFbFS08DJveeKV qCGZHc9aUNpcV/hPQm4HcFr+b+hTR5tGCBinm9aclx5ELchE9E6NmZQZFqKFF5l6tBZxTiwvWP 6N+dRxaEgi3XhRqLleP/OSrOxPbjhBEIhblALLN2ZygLEw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f47.google.com) smtp.remote-ip=209.85.208.47; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1674752244; bh=/qz7ccRNGIDOEizS7LArWsQnabWtfOoqpd3ZoUg38C0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=RL4fNaFefF4XJ8LKerzfhzaCxqcQrA/4OuQ/KgQW3aTlH6N0khnvwfxyrR3vUGmfxsNSnZqDzo ytbQisxyPcIm0hVidzg0+XmD73SYhtzm2rd9q87cf3+dPoo/HriGhCEVNRmEgg0mym69nK8S94 xvKUgmzCCD8eLskB+U8kVUruFz5vWA4GWDCpfNQI2Ez4ErY081rtuBToY/HXbJlOgxRy4BIQev rBn4XQVfVZaIgmHOAyZb0QtnDxgjaps7fqR9Rb6XPny1Mlav/BjRf5D/xtaGfl5W+oIEaFGfl8 vd53jnl7ynD4Pd96v8SiaT/+42fVNiYYykzl5mfWoGXkmw==; 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:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=bfllXXziSmFRKjQJUmbKM303vBmDfrj/sWcHnFcM/lw=; b=TFk0Upsk8jsiu6qGdInrTd3ke2 cwAqNCx7WTQnp9rBp4ryY6mFLYbwfmlZklSXeBlMsRcwSFJztWECZjyDF4yvB2jtrGaugqpNbkpa8 EgJ1Jm0zcgGTtmMhQ7w+bgL96r5dRTH2nrs5N7iYWhn2AvGM9b7CV4dHsDMGQN80cUigcXhcIMHff MtiP6o+TiRBTrQN7E1XTCshxrSeI873KD6lAls29qOAHw8lOo9Bj6S5JZXi2qX9AMFSED7khuPvOI pMTDRwDB7o+vUg4mUV+dBry4FiDJrX362s/zo2zrsBeGvap1IhkUMeXl3VzlHRD0iEP4NOql8bZiX fuVlqtmA==; Received: by zero.zsh.org with local id 1pL5Yy-000FYj-6i; Thu, 26 Jan 2023 16:57:24 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f47.google.com) smtp.remote-ip=209.85.208.47; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f47.google.com ([209.85.208.47]:38476) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pL5YM-000Eqt-44; Thu, 26 Jan 2023 16:56:47 +0000 Received: by mail-ed1-f47.google.com with SMTP id m12so2441753edq.5 for ; Thu, 26 Jan 2023 08:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=bfllXXziSmFRKjQJUmbKM303vBmDfrj/sWcHnFcM/lw=; b=iEPJI8QobB9Hp9pvaYxNnV7sbsyOs807sCKk8E5uB2Rr3ZG291+AT57IGr5E7MFJcd JKyFTlIUeZjmLjbhHr5kYnUsM92ovIgglUogqr0T1jmtCsVMj7z5HiXgMmteoUlnFXwd c41XfxlqJZH97sDFYnElVsZ5y2oRwPO+TkxZdZoUP1dFp5cCBTrx5U7Yim4DWfDrgq3F g6/vnQTuZ4PJY/HJ6WmTLmRW5HrDEP7+FR+JrJCS0WjE+pjdK6hUzSJcfO0Xmdrz64NP UbjiQQH7nhy2SqrrGnBMY8IBbYO1Sz0Yfn0Yx3RfPTHFrjh8JZq/N7lWaXp3JVcZDGhf 5N0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bfllXXziSmFRKjQJUmbKM303vBmDfrj/sWcHnFcM/lw=; b=JUDql607siyFwqNSKxH7OpMSztqddt82UgiW9JRuPmlrAwbBtQn8JKQvFHyCd4GLdh 53wuvSl7g+U11AFR6QrL3RtGNCx/OynkxmZlQcwQRGeFGTTcgxC6uYYdpaCSUILWVW0a /piv4KqGSRJypw+2BsYfKbsZIhfLUxp9HIlNZh4aAscNdfyQv4b1xvvxQXkiB8Et/OCk mq6ZFcjq7NBNBfvzP3yrR53/F8wHzrkZdSfVR4BzJaQVFftfzaEQpRm0lOwu70PFFB+I dKEI5YllXOt6HQqsZNFooB81+i/KsKvBVaLP8bywXe7KE6Yzkh1AM2S9Qi190twtjXy4 yu1Q== X-Gm-Message-State: AO0yUKXkvFGPlxpKWCcyWk9i57PUohRpdhc88QGUfLCfPpi5cwFWmiY4 /MpzL3NtBDvh5cBsD6dzeOYdwBKcmMIXarudE70ucg== X-Google-Smtp-Source: AK7set8VxH2jPOsgMv5ISXbRQ0aIQjgsJho/qOFy9AKntjN+RB8jRIlHxzd0qhIaspLyqHys3L2iSC71AyaloOoRTQ8= X-Received: by 2002:a50:cc46:0:b0:4a0:902c:9da2 with SMTP id n6-20020a50cc46000000b004a0902c9da2mr1998482edi.62.1674752205489; Thu, 26 Jan 2023 08:56:45 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Thu, 26 Jan 2023 08:56:34 -0800 Message-ID: Subject: Re: time command with shell builtins To: dominik.vogt@gmx.de, Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 28811 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: On Thu, Jan 26, 2023 at 8:23 AM Dominik Vogt wrote: > > Is there a more elegant way to chek if the command is in a > blacklist than this one? > > if [[ -z "${1:|_zsh_recordtime_skip_list}" ]]; then Alternate methods, judgement on elegance reserved: if (( ${_zsh_recordtime_skip_list[(Ie)$1]} )); then Or maintain _zsh_recordtime_skip_list as an associative array and if (( ${+_zsh_recordtime_skip_list[$1]} )); then In that case you could further use patterns as the keys of the array and do if [[ -z ${_zsh_recordtime_skip_list[(k)$1]} ]]; then or even use a zsh/db/gdbm ztie'd hash so that new items could be added to the list and potentially shared among shells. Note that ${+assocarray[(k)pat]} or [(I)pat] always returns 1 even when no matching elements exist (that is, the result is empty string rather than unset). I'm not sure whether that should be considered a bug, but it's not explicitly documented.