From owner-freebsd-questions@freebsd.org Sat Aug 5 12:27:58 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17311DD3409 for ; Sat, 5 Aug 2017 12:27:58 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) Received: from nm18-vm5.bullet.mail.ir2.yahoo.com (nm18-vm5.bullet.mail.ir2.yahoo.com [212.82.96.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 796077361D for ; Sat, 5 Aug 2017 12:27:56 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1501935942; bh=gqBQ72YF/zhSkbeowxJrz4myof0/vXtGQazXnz/mPeQ=; h=Date:From:To:Subject:In-Reply-To:References:From:Subject; b=HIJT3AvlF+r1zW/y3oRw8PWNxBCZecrvDNDuGESoOsgq3EjQV8aQt95vIdYKGPWtr86zgj5rzsiTVnJCgPoqZ67dFpMIBsTIK5hm6wHBfZnK8xVFZGV4jILKquxVdEFYGi6WFnfGVI6+pD5Wtj9fzp4X0bR3ki+dhpweS7hDNyKn4PXq+eyYfWKVT1G+WTMxKxiDNLfwWk87SOw7u/Z3D1wI5xStr3LXhVtsDkhiATTu/BSqL6aNeN8Y02+PVBrsiNiZ5G0sEEOG8JkpiqU/qDQCoK4PMWy1ps+b8dui1Asp/VdeFfiyLrg4lQVnz+/uy/yXOZRlnbJfFm0H9Hw39g== Received: from [212.82.98.127] by nm18.bullet.mail.ir2.yahoo.com with NNFMP; 05 Aug 2017 12:25:42 -0000 Received: from [46.228.39.76] by tm20.bullet.mail.ir2.yahoo.com with NNFMP; 05 Aug 2017 12:25:42 -0000 Received: from [127.0.0.1] by smtp113.mail.ir2.yahoo.com with NNFMP; 05 Aug 2017 12:25:42 -0000 X-Yahoo-Newman-Id: 96088.26397.bm@smtp113.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 6RkhEqsVM1mH.uC4Kqw_4n18vKZof5TEHKX76DDHMaDypGE jos00X5m3lfuIbxLE2h9svrAvnk1JtVBvfICR26E16an1hUAu.ypWbUieSXN heFbbu0SbUdum0bgr95LcAoodoSsY__HZJu8sbW5Xs8XJurfFUjm66kOR3qW T4Q8lq_NoVpX4YjyU9LtJvEl75fBpU2D3tB3BORJoke7gz9kuNguBqzuuh8Y Zj1kjyjVz.RTX06mQqzCpLMKLL3vOWru7Y9HqIGsv.nLSyeNp11Q_ro.whie A7TV_9RWTY9Yk5XUxM0ACd59B1dN9GUbWxck2UxPy_JI57iDySsPcldKN_aM vdgWohQd0.QpMMi_oLX.VIxVYv2VdKCbXvrKFZ8CT1u6AV35z9WrLjMzKajK LEukNB6iJYBWkNk6435Sb56eNWNZ5QuV_XLa8NJhdN8iSWWPbo4AG6ahVtY0 smsGpcJVHMnTYVuUsp7G9Fb3GYRfl1NV9uRvI4Ci0JiUzUN1Biczbwt3FC8P fbjuuG.lAgGeAsQjnAeSkIGaYEZRYx8c- X-Yahoo-SMTP: BeMCPs2swBABTJ3kAeEiC_hE0mz8jRexLddJfD8pI2j32fOacjBmXg-- Date: Sat, 5 Aug 2017 14:25:42 +0200 From: Ralf Mardorf To: freebsd-questions@freebsd.org Subject: Re: Wildcard on redirection Message-ID: <20170805142542.499f4cee@archlinux.localdomain> In-Reply-To: <20170805141306.60e720f5@archlinux.localdomain> References: <25f022f4-4778-3f28-8d78-1f1b292f849e@cloudzeeland.nl> <20170805141306.60e720f5@archlinux.localdomain> X-Mailer: Claws Mail 3.15.0git72 (GTK+ 2.24.31; x86_64-arch-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 12:27:58 -0000 On Sat, 5 Aug 2017 14:13:06 +0200, Ralf Mardorf wrote: >On Sat, 5 Aug 2017 13:58:50 +0200, Jos Chrispijn wrote: >>I have this number of .log files which I would like to empty. >> >>Using >> >>echo > *.log >> >>unfortunately doesn't work so I created >> >>foreach file in (/myfiles/log/*log) >> echo "" > $file >>end >> >>but that sequence is not recognized at all. >> >>Can you tell me how to solve? Thanks! > >I suspect the dot isn't useful at all, I guess with or without the dot >"analog" would be "*log", too, but actually your shell might treat the >dot in a different way. > >However > >echo "" | tee *log > >does the trick. > >https://www.freebsd.org/cgi/man.cgi?query=tee&sektion=1&apropos=0&manpath=redhat Oops, I'm at least mistaken for bash, but you unlikely use bash, right? $ cd /tmp/ $ echo "12342" > 1.log; echo "1234" > analog $ cat *log 12342 1234 $ cat *.log 12342 $ echo "" | tee *.log $ cat *.log $ cat *log 1234 so the dot makes a difference. I was confusing it with the dot at the beginning of a file and the asterisk as wildcard in front of the dot or without the dot, when using "ls" in bash.