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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5129 invoked from network); 9 Nov 2022 08:20:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Nov 2022 08:20:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1667982047; b=BDfp/1WE/OX06lIt0t2reG6EoOTzOcnxOC4pOaviTWQPbWkp3eJ1RdSaCAMv3yHS5N4hN37EFP LzkryFKye1QNjoJyKs1v/meKl1lYT0vM8iGsNnMZPn1ogTJ2e29sFoH3YoIiufvzYXOTz/ajsw lvFVMeTWP7xDoBWO2R1cI20/eQQEibhAK645TZuhl+GkLYVewUnniQ/ZsqmD0pBFbah3NPtr0h CfAwURXQu4Ejp8Vv/HHz/r1dFiDgaKDEbitjcw00OX1nwX9hvMeQQBA0PUvN7gLjvFshL7GClq h5wrYsdy+cKoqp1yQduV+tPlYmJADqx+LD92Zrthz9Ebcw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f174.google.com) smtp.remote-ip=209.85.219.174; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1667982047; bh=zzjKhQ6WMxLPjzSrSsKcrsJ8m2stzgXetH4ixUTJWWE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=qm9it2mbal2IuRWs9xwosf2ZknryoTFM2bSJdYom/L04VSZr0ZJz3wup3NtdkwwLp30Dx+Pi9i hcenWDxR98WH06obrjKl/VcxzsG42VmgbZ6ZD+GWRc0DndoA7K3NKjHlrSKCfowAcql8TosWIr rz6A9qg5wKw/e3tOb7rZ9NuC/sqB2fJbO+nXegzIs/JTGDO7rF0KUzeNGuZxMOaOMsP5yzqY87 ueZN0dwlde+xhBzrxQKl+YmLlTVLLLl2Xa9eiAdlYe2zzLIfGtPKa0VxUPyEuvmAeqFBuBQwYx vNwdjfQDMKvjGYSYj/PuVwGYvlrv5C+EndrrkeT44gosJw==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=sBUeN7Bul6abNAj9QjGBD81smHN0gMW6H8dpsdAON9k=; b=AWKoRjhto59VoM930V5E/ASpsZ jivbtSsRW5/ODzZBBR/3PIGNzJAhgktdU8PSXaQsI1/7B/X+D5o9FxplADVHnuDckhr4v8I5B51St 19O3QTef+IJVXipRF2XrkifQ/V2IuOsOUzXGG+Jk3lPwKBdL2azQdqFSqqP6jS/3Ye/NKBZ9nSvG9 bideFDk+pRMK9gZ1ax7DbtN3kUpsjg7HGhAOBpGIszkbjjKCJIcskURj/Q0ELadWTbr97ZcGEAyzs jc3vuVaNNsDn0psyyrTRA8kxZeUlxShx2FZVKHVvBgJBbv7P9YGnRpPtJWdvkhX4eNTHNlTO5IY6A riwqLdBg==; Received: by zero.zsh.org with local id 1osgKC-000Fmn-VZ; Wed, 09 Nov 2022 08:20:45 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f174.google.com) smtp.remote-ip=209.85.219.174; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yb1-f174.google.com ([209.85.219.174]:39499) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1osgJQ-000F5Q-6w; Wed, 09 Nov 2022 08:19:56 +0000 Received: by mail-yb1-f174.google.com with SMTP id j2so20162314ybb.6 for ; Wed, 09 Nov 2022 00:19:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sBUeN7Bul6abNAj9QjGBD81smHN0gMW6H8dpsdAON9k=; b=ImWhQlEnKIwgozyllY+gVxKWfKbRH3S5V7XAvWmFQdBt7klHb1RzbZ3J8BwBsEKoel rrPXO/xDN158qhef8BH9a29NBit5/qW9sA6RbiJzXhahUpG5QO+LYjfsk9eLUA5X3yxi El/we1ISDpIPqnRIm7KokH5/yxJqHIr+iT7eDUIW17+fqD/y+va29Z3vhP/VyhsDfYFH CJdbBhHFLTrFW2bMmxVGPXj8Ve0/pLwaasUOgiAf3D476MFhmH9gtEKJMbb1CL5+a+Mn t1s1NG21OqNg8L4LnWkTFGgg2m2IQUxtnAQNWEfhxzXGjHnF+r+TDnFUWwmSFeKjhvWe GrOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc: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=sBUeN7Bul6abNAj9QjGBD81smHN0gMW6H8dpsdAON9k=; b=geWlTlx8CRpgwjhLzdDKABOUcv5+XbK+VaKxZW0CVgEIEKMjgf6trQHrVKJBFRqWKM yb9pVl2CneB5VpKMYQqhQBeFs2NCmAx2SbTWXtgKiCFCpYwLKGFd3YC9pC0V26awcsL3 k6XYmqvbr+jUe/bEEaTdi2UPhYacu4C/y4hT3l+xX/u016EM6J5j3MC8npiGhXdVUJK7 a7gl6608+/kdQoTpkYYMMZW8Fx488SqupXYBy3ocqNG73ViOa8ZNdRCHIC2xzNpLQQuH Y+2eVi5ClzjHpqEzysOpFZlAERKJ6aUtF8BBsl1IP9m2idO5RVPTyoL6Vds/yrBmVeXu kQcw== X-Gm-Message-State: ANoB5plK/+yRQStqsH1+/lNN9L+i2JIq9ifzlAnfE3n2Cs6mpMnqTDhe DqDQ2EWM7CZzqbL4YmZIbcnVLXLzJF96VMkLTcg= X-Google-Smtp-Source: AA0mqf65q8S4hF1V3pbXJaKYeh7m7R+M+4H+6rk/JihrS954FK+SVLDKP8qyDbQkX4l+1OwjRJpdGA0BPel/2dY5hkU= X-Received: by 2002:a25:d655:0:b0:6d3:7c5a:9d39 with SMTP id n82-20020a25d655000000b006d37c5a9d39mr26020661ybg.175.1667981993419; Wed, 09 Nov 2022 00:19:53 -0800 (PST) MIME-Version: 1.0 References: <5454df12-02c6-75b5-e552-c486e231183c@eastlink.ca> <1b44b09a-ebae-a45d-a19d-c83e1ce68f65@eastlink.ca> In-Reply-To: <1b44b09a-ebae-a45d-a19d-c83e1ce68f65@eastlink.ca> From: Roman Perepelitsa Date: Wed, 9 Nov 2022 09:19:41 +0100 Message-ID: Subject: Re: coloring a substitution To: Ray Andrews Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 28349 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 Wed, Nov 9, 2022 at 12:50 AM Ray Andrews wrote: > > For globbing for files on the disk: ($zsh_case = '(#i)'): > > [ "$wild_msg" = 'WILD' ] \ > && eval "wholedisk=( $zsh_case/**/*$1*(/N) )" \ > || eval "wholedisk=( $zsh_case/**/$1(/N) )" Try this instead: if [[ $wild_msg = WILD ]]; then wholedisk=( $~zsh_case/**/*$~1*(/N) ) else wholedisk=( $~zsh_case/**/$~1(/N) ) fi These cases would more traditionally be called "partial match" and "full match". > if [[ "$scope_msg" = 'BROAD' && $dirname = (#i)*$1* ]] \ > || [[ "$scope_msg" = 'Case INsensitive TAME' && $dirname:u = $1:u ]] \ > || [[ "$scope_msg" = 'Case Sensitive WILD' && $dirname =~ $1 ]] \ > || [[ "$scope_msg" = 'EXACT' && $dirname = $1 ]]; then Try this instead: if [[ $scope_msg = 'BROAD' && $dirname = (#i)*$~1* ]] || [[ $scope_msg = 'Case INsensitive TAME' && $dirname = (#i)$~1 ]] || [[ $scope_msg = 'Case Sensitive WILD' && $dirname = *$~1* ]] || [[ $scope_msg = 'EXACT' && $dirname = $~1 ]]; then If this works, consider using more traditional names for these cases: - case-insensitive partial - case-insensitive full - case-sensitive partial - case-sensitive full You can also shorten "case-insensitive" to "icase" and "case-sensitive" to nothing. This is a commonly used naming convention. You can also use $~zsh_case in here. Roman.