From owner-freebsd-questions@freebsd.org Sun Sep 17 20:22:47 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 4A4C0E02814 for ; Sun, 17 Sep 2017 20:22:47 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) Received: from sonic310-13.consmr.mail.ir2.yahoo.com (sonic310-13.consmr.mail.ir2.yahoo.com [77.238.177.34]) (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 DAB4B6C938 for ; Sun, 17 Sep 2017 20:22:45 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) X-YMail-OSG: GaKnymoVM1kHc1ydxGxhk2l4PCfS8Wt61r8_zls6iMsYU3I8rznI46K94SbtEYP uD_6f1qVX6_eg30D410N4mjsU6z2MRxN5TS4V1F8h_dEkqrsneS45Bh1GtrI_xngmPkLAj6fRvYf 4mQVJazh9V651vKqUdVIA_50L16Me0BVHjZ_wQJZ4fDhgr9rYoipOzhk29jZ_O642biyytt_zuEk fpztsrpApjV1e6kGb9UENo_X71qTPW6OX1BJDX6bT2ZZQAm2TcOOmxwoCSErg2igF2xlmvq8e85m Ot_7Aids7rwdP39CpR3Rv6eCepFX0Ckkhs3yw455uRX7tg87vdBIYfTT2X9L5w0dsOXORMayk_gQ 3mhpj96suj2BmmJqnn9Emu3KshdtctkZIRD.Zxjc6qT5uuV7K.kfr8OqYwmF8WgHWc3gFV62tlCj YVuU6Vah_DbKNJDGgpGAqETpGeWppGK2I3l9NXtbdfhut.TXKYHecY34UD9xfavnmG4TF3ar0aA7 nZWImuH3KHtJPSqXN5JprdEjNFUtILBD6vbbvu8E- Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ir2.yahoo.com with HTTP; Sun, 17 Sep 2017 20:22:43 +0000 Received: from [127.0.0.1] by smtp130.mail.ir2.yahoo.com with NNFMP; 17 Sep 2017 18:02:45 -0000 X-Yahoo-Newman-Id: 260236.41673.bm@smtp130.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: GaKnymoVM1kHc1ydxGxhk2l4PCfS8Wt61r8_zls6iMsYU3I 8rznI46K94SbtEYPuD_6f1qVX6_eg30D410N4mjsU6z2MRxN5TS4V1F8h_dE kqrsneS45Bh1GtrI_xngmPkLAj6fRvYf4mQVJazh9V651vKqUdVIA_50L16M e0BVHjZ_wQJZ4fDhgr9rYoipOzhk29jZ_O642biyytt_zuEkfpztsrpApjV1 e6kGb9UENo_X71qTPW6OX1BJDX6bT2ZZQAm2TcOOmxwoCSErg2igF2xlmvq8 e85mOt_7Aids7rwdP39CpR3Rv6eCepFX0Ckkhs3yw455uRX7tg87vdBIYfTT 2X9L5w0dsOXORMayk_gQ3mhpj96suj2BmmJqnn9Emu3KshdtctkZIRD.Zxjc 6qT5uuV7K.kfr8OqYwmF8WgHWc3gFV62tlCjYVuU6Vah_DbKNJDGgpGAqETp GeWppGK2I3l9NXtbdfhut.TXKYHecY34UD9xfavnmG4TF3ar0aA7nZWImuH3 KHtJPSqXN5JprdEjNFUtILBD6vbbvu8E- X-Yahoo-SMTP: BeMCPs2swBABTJ3kAeEiC_hE0mz8jRexLddJfD8pI2j32fOacjBmXg-- Date: Sun, 17 Sep 2017 20:02:44 +0200 From: Ralf Mardorf To: freebsd-questions@freebsd.org Cc: Polytropon Subject: Re: case command Message-ID: <20170917200244.67a5ca30@archlinux.localdomain> In-Reply-To: <20170917194020.8f6db248.freebsd@edvax.de> References: <59BE89E1.3050209@gmail.com> <20170917155649.e869897ddcc97c3c9d04929c@sohara.org> <20170917194020.8f6db248.freebsd@edvax.de> X-Mailer: Claws Mail 3.15.0git132 (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: Sun, 17 Sep 2017 20:22:47 -0000 On Sun, 17 Sep 2017 19:40:20 +0200, Polytropon wrote: >% grep "catfood" < food.txt > mister_kitty.txt Regarding https://www.freebsd.org/cgi/man.cgi?query=grep&sektion=&n=1 it should work without the "<" the same way it does on Linux [1]. As already pointed out, the inequality signs/angle brackets cause issues when sudo is required. [1] $ ls -hl bar.txt -r-------- 1 root root 4 Sep 17 19:49 bar.txt $ sudo grep "foo" < bar.txt > out-file.txt bash: bar.txt: Permission denied $ sudo grep "foo" bar.txt > out-file.txt $ cat out-file.txt foo $ sudo grep "foo" bar.txt | sudo tee out-file-2.txt foo $ ls -hl out-file*txt -rw-r--r-- 1 root root 4 Sep 17 20:00 out-file-2.txt -rw-r--r-- 1 rocketmouse rocketmouse 4 Sep 17 19:58 out-file.txt .