From owner-freebsd-questions@freebsd.org Fri Jun 21 05:53:45 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBDB115D17CC for ; Fri, 21 Jun 2019 05:53:44 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A811E817FA for ; Fri, 21 Jun 2019 05:53:43 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.12.231]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPA (Nemesis) id 1MwjO6-1iXovz3SdG-00yAl4; Fri, 21 Jun 2019 07:48:33 +0200 Date: Fri, 21 Jun 2019 07:48:33 +0200 From: Polytropon To: Robert Huff Cc: FreeBSD Questions Subject: Re: How to un-select files in shell wildcard patterns Message-Id: <20190621074833.91788e9c.freebsd@edvax.de> In-Reply-To: <23820.24473.509724.279485@jerusalem.litteratus.org> References: <20190621054909.c6ba47ab.freebsd@edvax.de> <23820.24473.509724.279485@jerusalem.litteratus.org> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:BuE4XHO8DDsxCODJ7Iq0Bx7dLPNo9CJm2xPIqpEvb/CHTUazVn/ lA18kQFkAArHop8vnpw15kDw1HjG2R1xRsoQ8HLF+lqQsA/FPlS32kA7Zg+ah9c3YED7DZh Yr9QOHLbFeruIdc/cZPgaEh3G5vgGRLFj+1D7ZYT+0KZo7H1doIR/xKaXAduz9OWwBcoKij vbNfYdI8T6YM+oKdyOilA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:VgUZ4e/MTbU=:7+BeL9n7xeQ7XIJ7zqsKEE +zyP4jRhjeKG5Bn6w4SkTu+kLcwV4BxwkrDjzorj/hhPa5YeGoJx1PIWoPZVFbZjcAbmhOfZ2 9DiBtu2uVPo/8vbzl1XwXKVybGtpNwnWA4r3rYYXEjAoMUcZDFT1Vq31mG0pdaIv2pzkdbzf4 bMoJWeZe6KIViCrJ0TQY6btuoZPcEfT1OOHCa33/eA7uW4NMQo/lwzBt2I8urXGaK4Ym9W+Qh huso2KNopFcul+TJD+wbKEoFpvhRmMwVl2unrdXZo/FfHO5mUSb9LK2RutMOBADGYjK7AWAhD lznuZNgdbx6I+GR0IB+Qwm0T3LnCdd812ayS0wKSOCupEt0TXNqxfwwrLD0tSfXdH2G1PEWzU QdINNXuJWp1gJTg/MgKWdEvPpVHmPiIVBscQw8+QCAPcF0UBMkTaHEzBSjVzK0VFJ6C9zW3XH B4B59Gt682cH8mabxq6SNrLLV3a/rmaD/NEoBFPk0+fgOtg8JYBn6JQNRLqP509Vm+XvqhzNI 7CdXjovu22/g8+6X3bOhXOXIkKMqjNieWiPPqtCwldJ6DtGQ6eoP67YatevfEKuIXCdCScsQc 4Jg/7IeS5nW64z6eQH96ju5dXPZIT1xNPIwRGXHmVA1A4mHnHXXK2BIXHE8xjAdFlb8VO9YkL v9HOWZA+tEYgs4iwU4qGh3IksLuGvQqWPQhhofyRFsCsxprLccQZ/KAp3jEy88bg7Q0N5HqyE jjN3XfFFuNrpnzJFTEG9d8Kmf0paeeItHrrCDY2bR+rd+2CeRXLCw+HV+a4= X-Rspamd-Queue-Id: A811E817FA X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [4.48 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: mx01.schlund.de]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.72)[-0.715,0]; RECEIVED_SPAMHAUS_PBL(0.00)[231.12.222.94.zen.spamhaus.org : 127.0.0.11]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.99)[0.990,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[133.126.227.212.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.81)[ip: (2.99), ipnet: 212.227.0.0/16(-1.42), asn: 8560(2.50), country: DE(-0.01)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2019 05:53:45 -0000 On Fri, 21 Jun 2019 00:39:53 -0400, Robert Huff wrote: > > Polytropon writes: > > > I'm interested in a convenient method to "un-select" files > > when using regular (sh) shell wildcards. It's quite easy to > > describe things like > > > > *.tex > > > > to perform an operation on all LaTeX source files, or > > > > *a* > > > > on all files whose name contains (at least) one "a". Patterns > > that are based on the inclusion of certain attributes are not > > a problem to deal with using the builtin pattern matching of > > the shell. > > > > But what about the opposite? Let's say, perform an operation > > on all files _except_ the LaTeX source files, or all files > > whose name does _not_ contain an "a"? > > > > Is there a good method to do this, except creating a kind > > of "custom regex wrapper script" that does the selection part, > > for further use with `subshell` or | xargs? > > Um ... does > > Polyt> ls -al "*^a*" No, does not. Not in sh, not in csh... ;-) Of course, the simple negation works as expected in tools like awk, for example: "ls | awk '!/a/'", but I thought there would be some convenient way to achieve the same _within_ the shell. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...