From owner-freebsd-questions@freebsd.org Sat Aug 5 12:34:32 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 51D25DD3B0A for ; Sat, 5 Aug 2017 12:34:32 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF43B73BF7 for ; Sat, 5 Aug 2017 12:34:31 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wm0-x241.google.com with SMTP id y206so8477095wmd.5 for ; Sat, 05 Aug 2017 05:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=kTZxTxKjW9JX64Wm4xovrTZvwlBjGCD2LoiYwP0jbdc=; b=C80SNkCO6Zc3JZANImLpB3dXuGqDVofkx2TihcwynvxiYV2GzSV8geFnnt8i4PJsYk TT/aUnMMpTosyq7xiq3u7aUBD660qcujFP0ljHrUUKvBJ0tYVxwQm4apMom2bWzPCpDT Ak8S0E8a6yAwnbg8Z67bZ6GA1JRgkKmAkxiGwzBzX0vmTHTse1Tk4QPOvrxm19zmH88P z/YvyJUQ9GL4bG4GhK6so2sWsYgtp9EyMhqiIWw6v0yAz33jiQ1HAEj+Ot7Tfo7JbqGy vvQluPSVlCVyXRQwQE86nv7oJ0bJ0J2NpdASrVpDiYgMxcXn1k3gx5rQbJ4Aoj3fncId fvpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kTZxTxKjW9JX64Wm4xovrTZvwlBjGCD2LoiYwP0jbdc=; b=mUBAZds7qMfA92Fvin//dsLdRn+OMscS2cHmYaVPfcnxu/A77m1FHyHO+j92F8X/Tx u4tnNXihRVYxaXV2YYvz9apkhrWdX+HXN0wu79IJwG6nHgKYggxYzXRrceOOnGNV7usM sqeFb5k4CbD3/ahRLqV7vTHxxHsKDpxweicgEDohZngbv7Pxg2iy+RD4PIQNJ8rWuy/f OYL8T9fw3G97tKTwnVPll+ni/OVgkZhzTplFz3znoZCL+8B1lLgl92xMVjP1J86COjin 6ZMi9zKpUIgPIfO/4CYd9R9Zhh4NICKttWNrOD7zdjPkdttcZJoBfDMmjq4EXCHCh8hI HlxA== X-Gm-Message-State: AHYfb5jQY0XrTH7Y1ScKxlIk5XeSOPKwdkbuxhJtOks7Que3qg8747s4 SONWQfoKtUm4UGwY X-Received: by 10.28.194.135 with SMTP id s129mr3133474wmf.160.1501936469984; Sat, 05 Aug 2017 05:34:29 -0700 (PDT) Received: from gumby.homeunix.com ([81.17.24.158]) by smtp.gmail.com with ESMTPSA id g84sm4350723wmf.30.2017.08.05.05.34.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Aug 2017 05:34:29 -0700 (PDT) Date: Sat, 5 Aug 2017 13:34:25 +0100 From: RW To: freebsd-questions@freebsd.org Subject: Re: Wildcard on redirection Message-ID: <20170805133425.56aed83f@gumby.homeunix.com> In-Reply-To: <25f022f4-4778-3f28-8d78-1f1b292f849e@cloudzeeland.nl> References: <25f022f4-4778-3f28-8d78-1f1b292f849e@cloudzeeland.nl> X-Mailer: Claws Mail 3.15.0 (GTK+ 2.24.31; amd64-portbld-freebsd10.3) 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:34:32 -0000 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. Assuming you are using /bin/sh or another bourne shell for file in /myfiles/log/*.log ;do echo "" > $file done Strictly speaking echo "" > $file doesn't leave an empty file because it writes a newline to the file. If that matters you can use one of: echo -n "" > $file printf "" > $file :> $file