From owner-svn-src-all@freebsd.org Wed Dec 12 01:00:34 2018 Return-Path: Delivered-To: svn-src-all@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 0F71C13253C6; Wed, 12 Dec 2018 01:00:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E8D16A5F6; Wed, 12 Dec 2018 01:00:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f43.google.com with SMTP id r200so13431466iod.11; Tue, 11 Dec 2018 17:00:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=gXtL2gOlKYyLaoFBhSA+J5ooSXf4b90E0Lx0oVfz0Yw=; b=uGeRnspVG5RgKzNWzE8AZTGHYZ21urcvs8UdKQjnDBHMVyBRxYAVz1qITiKJxMReNK ZcceFQ1yqWkW3SvxdPFY8W4ALiKMmpgffjq8MK0QdFMFJ2BFPPjT6NOdukTdHmk5iSVz 1JbXdHpsLL1/hCfQTTwm2lb+M0fuFmPa8Z/lGiQweRwwn8p7h8tFBZCZwkfRXeH52mcK 853irzYWidDgpM8NMuJvfAVXtsOkLWw4vLbpAOc+Qy2KPfl25rQPy4fxWcXju6tfWCXq jUC1MIPpaq2OzWOfWEqf+fise0paaaDMJtDwOxtv4F+tidjjB9jeHqHuAc0iTnHc1pVk 1Kig== X-Gm-Message-State: AA+aEWZw3IkXWMKC1sAfYBuJndMa0D/PJsHZdeuYONFTz6AZIQoxIPDs LS6vzGCKw+7tht2zvz2jEEQM9h2L X-Google-Smtp-Source: AFSGD/V2a9c8beExcZT31rFWg6kdrDdL5odUNBXWLYI8L64VXl+9SkqBwglB2YcY0Bgs4yywSh4qYg== X-Received: by 2002:a5d:8989:: with SMTP id m9mr15535302iol.216.1544576427378; Tue, 11 Dec 2018 17:00:27 -0800 (PST) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com. [209.85.166.180]) by smtp.gmail.com with ESMTPSA id x99sm2104412ita.23.2018.12.11.17.00.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 17:00:26 -0800 (PST) Received: by mail-it1-f180.google.com with SMTP id z7so6629267iti.0; Tue, 11 Dec 2018 17:00:26 -0800 (PST) X-Received: by 2002:a02:c88:: with SMTP id 8mr17341359jan.87.1544576426488; Tue, 11 Dec 2018 17:00:26 -0800 (PST) MIME-Version: 1.0 References: <201812110138.wBB1cp1p006660@repo.freebsd.org> <2a76b295-b2da-3015-c201-dbe0ec63ca5a@FreeBSD.org> <98481565-CDD7-4301-B86B-072D5B984AF7@FreeBSD.org> <917251B0-00E0-47E2-B6FB-568EDB9ED781@FreeBSD.org> In-Reply-To: <917251B0-00E0-47E2-B6FB-568EDB9ED781@FreeBSD.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 11 Dec 2018 17:00:15 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r341803 - head/libexec/rc To: Devin Teske Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9E8D16A5F6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.93 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.926,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2018 01:00:34 -0000 On Tue, Dec 11, 2018 at 2:42 PM Devin Teske wrote: > In that case, would it be appropriate to say that: > > blah | while read x; do ...; done > > Is always more efficiently written as: > > IFS=$'\n' > for x in $( blah ); do ...; done I don't know. The suggestion came from jilles@, who is much more familiar with sh(1) than I am. My understanding is that it's important that 'set -o noglob' is set, or else 'blah' lines that include globs may be evaluated against the filesystem. There is also a caveat if 'blah' is the 'set' command, or similar, in that IFS' own value itself will be split across multiple for loop iteration 'x' values ("IFS='", "'"). I would hesitate to say "always" given my limited understanding of the shell, but it might be true. Best, Conrad