From owner-freebsd-questions@freebsd.org Fri Oct 16 02:40:18 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90AC944CC62 for ; Fri, 16 Oct 2020 02:40:18 +0000 (UTC) (envelope-from bourne.identity@hotmail.com) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-oln040092066011.outbound.protection.outlook.com [40.92.66.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CC9Nx1RSHz4KFn for ; Fri, 16 Oct 2020 02:40:16 +0000 (UTC) (envelope-from bourne.identity@hotmail.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=maIeQKPg0sZ00xIeABKTqI6vKHO4vwqq28i/ma/YBwhR+odorAzn5fINB60TTk9/gCdWSu4A6doHpA8KYFCUCFa7Qpl/+n3jQqCfsgZkBDCmnRCPnDDfbfnomAVG6/gR0gvssiwZe2vDZEn6wD8I7NKjpgjPJxYLqYcwn7PLlDW0VhBIL8IJcpH3Ol1afVHyvC0jh6L9bUDPX522f0m+lmrnrHYaEIvKoVV6Rnh1v+AQElG6nNg4iUSeB5O/TfLnbrEV4h4a0Zvu0/k9ZQCe2alb6JiiEyP44vWkqGXL5EtkhZ0oXp6GQKeRxzHHmCaDqYmsL3ZuhDWd4+D5K93KUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yFzZ2SEISl7Bp2pn0StJFNmOgSPlbtVsPVt3+4WiSz8=; b=NzvJ9pC/oloagVrU541CvQqMtMXauxVgyKNcXpiUGTDpoJc17Rr9Jj2CFoTKmOAupKCWex1X4K5mpHuxrLfoOQpOxSCT0uY3GhZQLzngzW7CwNtsdgY1Ub4Dq1C3VcdNxAJSV4ZKUdJCS5TWOlLTThUlufPZVtKxSIa5VmjoqMg5Ik3vhd/IJDffvowLZ2t0Nwa2bf4z5WKwZSogE1T/6+44IertSACFVX8l7ECNp2HdfoxasrVE8+xVDVg6sq8IRuLd/qhFI1py48iO5WG3Z9A5+th4U37ycKaTwQgdhpwSKZOOgIY1uLNdrNMbrjAw54L83ZWtpa72JJeZZzhyYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yFzZ2SEISl7Bp2pn0StJFNmOgSPlbtVsPVt3+4WiSz8=; b=Y3T2MNf/T0mdzIRHoTQUDqb45kbuS4RuMlHZXHgg0+BNJpo5TAdKXhsZ7yKk+ZhEYaGpwSirffDdhMrTQdk9Fj/0i4iIdgvL+pLJBjN3sWUiKARYedzYOE48V8MLOoYTsChXxlYV74r6YtZnmEx7mI3RJWOxOCtFCA+f0vslBiah/M+FZhnZNJQPJsxKXiPsViN9IGMbSPNb5W1dxBrs43TCB/s5vCoB7Qfx27Z8NA+PC+iQRehLUdlaMBKM1zLVma9Q9W9J3v0COsGKmfOTWH9mQTlf2ujvBgrE8o0s8gfieoQDyCiIWGQztmXYXUQJrVU8QKlb4Ooto7Ctr3GwPg== Received: from HE1EUR01FT058.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::42) by HE1EUR01HT029.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::341) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Fri, 16 Oct 2020 02:40:14 +0000 Received: from DB8PR06MB6442.eurprd06.prod.outlook.com (2a01:111:e400:7e18::4e) by HE1EUR01FT058.mail.protection.outlook.com (2a01:111:e400:7e18::218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Fri, 16 Oct 2020 02:40:14 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:21730E68069DC30E050E126FF1C609213B8CBF22C965477772CA521E7B7FD7FE; UpperCasedChecksum:B8D0B68BE60D40873AD15F8337EBD35646CB2B8825E13EDA3A491D362A0FD143; SizeAsReceived:8854; Count:47 Received: from DB8PR06MB6442.eurprd06.prod.outlook.com ([fe80::5822:2d5d:a176:574f]) by DB8PR06MB6442.eurprd06.prod.outlook.com ([fe80::5822:2d5d:a176:574f%9]) with mapi id 15.20.3477.023; Fri, 16 Oct 2020 02:40:14 +0000 Subject: Re: sh scripting question From: Manish Jain To: Robert Huff , FreeBSD References: <24456.60388.135834.43951@jerusalem.litteratus.org> <24456.61612.942942.811357@jerusalem.litteratus.org> <3aab3608-c9be-a944-77a4-6d0e3ac34c5b@hotmail.com> Message-ID: Date: Fri, 16 Oct 2020 08:10:07 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 In-Reply-To: <3aab3608-c9be-a944-77a4-6d0e3ac34c5b@hotmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit X-TMN: [w1AAu/ZkX0y3Jc00TPRAXiCzXrj8qkrFOfpwhak8YtY=] X-ClientProxiedBy: BM1PR01CA0152.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:68::22) To DB8PR06MB6442.eurprd06.prod.outlook.com (2603:10a6:10:126::7) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.2] (103.195.202.206) by BM1PR01CA0152.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:68::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Fri, 16 Oct 2020 02:40:13 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 0e82ba51-3709-4113-8b6c-08d8717ccf9c X-MS-TrafficTypeDiagnostic: HE1EUR01HT029: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: no6stN1OHn7WOZeSeM28dH4XCTi39K9T28d9qEDkABJRe6fE+IR2GK33dVTfuZbQHaVHDINxdC079sUtpJaVRMyB/XLy6ZWAprPcMciFvNCIP/aaj5CMoxVdWmN6GoJdLDzQvrWyvjPqJWuYcWdXdBJrI2+2kiJDemE3gwMGSkBz8rSZVbIDo6S/5zgVUNjlXNYSXaix5hTcx/2B4JaR8A== X-MS-Exchange-AntiSpam-MessageData: DfmsWZHDvqdOl95hLQlqwQqFXvYjZYczocxmD0AxcRkBcKaMKHzCAPFzFi0UMu8heUPnlqyKZqlsZ5kLw27irxWuYQjzbF6IXkfAnDBLTxb6DQrOV11hxmP4ZB+VkpiLTxyQSnjTsf2KRAP9GFTAEw== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e82ba51-3709-4113-8b6c-08d8717ccf9c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2020 02:40:14.8092 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR01FT058.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR01HT029 X-Rspamd-Queue-Id: 4CC9Nx1RSHz4KFn X-Spamd-Bar: ++++++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hotmail.com header.s=selector1 header.b=Y3T2MNf/; dmarc=pass (policy=none) header.from=hotmail.com; spf=pass (mx1.freebsd.org: domain of bourne.identity@hotmail.com designates 40.92.66.11 as permitted sender) smtp.mailfrom=bourne.identity@hotmail.com X-Spamd-Result: default: False [8.34 / 15.00]; FREEMAIL_FROM(0.00)[hotmail.com]; R_SPF_ALLOW(0.00)[+ip4:40.92.0.0/15]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[hotmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(0.00)[hotmail.com,none]; NEURAL_HAM_SHORT(-0.10)[-0.095]; RECEIVED_SPAMHAUS_PBL(0.00)[103.195.202.206:received]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[hotmail.com]; ASN(0.00)[asn:8075, ipnet:40.80.0.0/12, country:US]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; ARC_ALLOW(0.00)[microsoft.com:s=arcselector9901:i=1]; DWL_DNSWL_NONE(0.00)[hotmail.com:dkim]; RECEIVED_SPAMHAUS_XBL(5.00)[103.195.202.206:received]; R_DKIM_ALLOW(0.00)[hotmail.com:s=selector1]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(0.22)[0.215]; BAD_REP_POLICIES(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.72)[0.715]; RCVD_IN_DNSWL_NONE(0.00)[40.92.66.11:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.92.66.11:from]; GREYLIST(0.00)[pass,meta]; MAILMAN_DEST(0.00)[freebsd-questions] X-Spam: Yes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 02:40:18 -0000 Corrections: the backslash on the third line is wrong: > oldifs="$IFS" > IFS=$’\n’ > for f in "`cat files.list`" \ > #stuff > done > IFS="$oldifs" So that should be : oldifs="$IFS" IFS=$’\n’ for f in "`cat files.list`" #stuff done IFS="$oldifs" Sorry for the typo, Manish Jain On 2020-10-16 08:02, Manish Jain wrote: > > > On 2020-10-16 06:30, Robert Huff wrote: >> >> Hello: >> >>>    Try : >>>    for FILE in "`cat files.list`" >> >>     That's better ... but sets FILE to the entire content of >> files.list. >>     I'm trying to pick off one line at a time for further processing. >>     (I feel like I've done this before - successfully - and for some >> reason now it's not working.  ) > > Hi Huff, > > > You have to set/reset IFS : > > oldifs="$IFS" > IFS=$’\n’ > for f in "`cat files.list`" \ > #stuff > done > IFS="$oldifs" > > Regards, > Manish Jain