From owner-freebsd-questions@freebsd.org Thu Nov 8 20:52:42 2018 Return-Path: Delivered-To: freebsd-questions@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 951EF110584C for ; Thu, 8 Nov 2018 20:52:42 +0000 (UTC) (envelope-from carmel_ny@outlook.com) Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-oln040092012011.outbound.protection.outlook.com [40.92.12.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 B956A6C4FD for ; Thu, 8 Nov 2018 20:52:41 +0000 (UTC) (envelope-from carmel_ny@outlook.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=asKMhGrMleXWpO3Popq6GLt6EmcFZIethxiohMpS5qI=; b=aztbt7SyVGamcbyOscFijY3VGSYMm6phgeJR+Wz7Yi1gSAWRzlqDmrECMGFM9uTbYoEyRvGhsZaFHE9u9/sSNYzTpYbKa9IOCOq423U4VM33uVnjE1g36MvqyAGpqgF4tTi/7JTe3svjmHqJzQLFyb4JtYzLlnGucaFG8/S47cmZHWPa2MO52iBLb70Ccq4XdPG56NkvcrIaxYQQLq9YTfeftAGEwZfpvH0LGXAd/sDgWaw9sXUJXS+dD+fe8n1d+LszovYJgKu0/WWD0OxofUyQEvdzuh0ztP/1744OkRFPIu/GZ/QfGYwpmuzCGXXAT1myw0NjFEhkg/0rgBQMRQ== Received: from BY2NAM05FT061.eop-nam05.prod.protection.outlook.com (10.152.100.58) by BY2NAM05HT156.eop-nam05.prod.protection.outlook.com (10.152.101.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.3; Thu, 8 Nov 2018 20:52:40 +0000 Received: from SN1PR20MB2109.namprd20.prod.outlook.com (10.152.100.57) by BY2NAM05FT061.mail.protection.outlook.com (10.152.100.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.3 via Frontend Transport; Thu, 8 Nov 2018 20:52:40 +0000 Received: from SN1PR20MB2109.namprd20.prod.outlook.com ([fe80::7c41:6cf4:fe3a:fb1d]) by SN1PR20MB2109.namprd20.prod.outlook.com ([fe80::7c41:6cf4:fe3a:fb1d%4]) with mapi id 15.20.1294.034; Thu, 8 Nov 2018 20:52:40 +0000 From: Carmel NY To: FreeBSD Subject: Re: Append to "command" in rec script Thread-Topic: Append to "command" in rec script Thread-Index: AQHUd469OTPY1sLHk0u7rCGzZ3gslw== Date: Thu, 8 Nov 2018 20:52:40 +0000 Message-ID: References: <20181108193853.ee1404e2.freebsd@edvax.de> <20181108213209.159bf8f8@e5500.localdomain> In-Reply-To: <20181108213209.159bf8f8@e5500.localdomain> Reply-To: FreeBSD Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN7PR10CA0025.namprd10.prod.outlook.com (2603:10b6:406:bc::38) To SN1PR20MB2109.namprd20.prod.outlook.com (2603:10b6:802:28::14) x-mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-w64-mingw32) x-incomingtopheadermarker: OriginalChecksum:6F7100CFF1571562E9C63F518CA2436F15F8CE20F26E88754359AF63BA08E00D; UpperCasedChecksum:D465EE1B722C51754847E8E17F41808819942459C2ACD13031621547C279AC11; SizeAsReceived:7679; Count:51 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [XunKV3XJrWbAlkWeW/WCdLJH7tMJtuZ9BMDuObKAo5M=] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BY2NAM05HT156; 6:cltzZB4OXUfyqvVmAx5G84qguxEIxQiCqHrje6TaspUhhzIx1/KeE7KP0NdpozBxOqaUey1OkYEgDMsQLdxUrb3vhRPdGCuiL/4SMtopzWKx6cCLJapehg28kVx9bdNBx0Q16vTOGvsckTpVwz6LcxvzlnXGulRnnVJTu6nVmEqloqeGcbfezf4duwp5yxfeIYAbgvcpQ9dUKWibGOzHYljYUlwYv+cZonZJMWt+b3Ri2294W/kDxj44TSVeEtOAJWmHtBID8hFSj9LDbv/rAHf4kXXp0osHTUigEOhZLQ28gEATeRH/9ZXeBaKLCsPVW+vJ6wBAYzBhltjQV2G5K271RcdZWfsnIb+1tZuvL+wj7H0QesyO7XMJJB6ioMnoxNTaT4bl7PLPlRi6OQmWB88/prkswyMEbDFtnWf07zeGw4qdMl/8SHwRfoQKBlAczqvQBj0tBq9ZooQEGSDtgQ==; 5:pM+Bqh3LMb5LL84CasLr6JSmAi2wX6Gozb9u1/0pp+mjXANjnLo4UwcIKjA9RzLg7B6Bfq7tkvcBPgpEIDBOd3rpODuTs05y0iJvbx/FGp2AK3GaT5bXerbH+QUNT6UtFb1ujnLhWPCJOMtBTP55RVISzUeNj64R9CxY/+Vx5dw=; 7:2J7HTvS57XE1GztROTVxeolTh+DQo0UAPCtr9Z8TwrWxWKYL6MqhY7vd4MZQnkG94GiUGkku7mCnI8RNu1bM+ZAd3btin5qWBHICIxAWWvauWCec7a9eLakhH7X0rByXa6M6ifhRE9JRDiS9GYOYag== x-incomingheadercount: 51 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125500)(1603101475)(1701031045); SRVR:BY2NAM05HT156; x-ms-traffictypediagnostic: BY2NAM05HT156: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(4566010)(82015058); SRVR:BY2NAM05HT156; BCL:0; PCL:0; RULEID:; SRVR:BY2NAM05HT156; x-microsoft-antispam-message-info: Gt9NwAxenxPCOvuUZG4ZVEc32z4NEuL8xg5ep7qlDcW4ofE8yZoOuys6k8WjMrP6 Content-Type: text/plain; charset="us-ascii" Content-ID: <35ED158CD642254E8CAF5C461ED2FA0A@namprd20.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 9a4e3081-9524-43cf-bfc3-dcaef82d5da1 X-MS-Exchange-CrossTenant-Network-Message-Id: ce3ebff5-5520-4fec-679f-08d645bc1f29 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 9a4e3081-9524-43cf-bfc3-dcaef82d5da1 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2018 20:52:40.1811 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2NAM05HT156 X-Rspamd-Queue-Id: B956A6C4FD X-Spamd-Result: default: False [0.71 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[freebsd-questions@freebsd.org]; R_DKIM_ALLOW(-0.20)[outlook.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.92.0.0/14]; FREEMAIL_FROM(0.00)[outlook.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-0.60)[ipnet: 40.64.0.0/10(-0.62), asn: 8075(-2.28), country: US(-0.09)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[outlook.com:+]; DMARC_POLICY_ALLOW(-0.50)[outlook.com,none]; RCVD_IN_DNSWL_NONE(0.00)[11.12.92.40.list.dnswl.org : 127.0.3.0]; MX_GOOD(-0.01)[cached: outlook-com.olc.protection.outlook.com]; NEURAL_HAM_SHORT(-0.68)[-0.679,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[outlook.com]; ASN(0.00)[asn:8075, ipnet:40.64.0.0/10, country:US]; REPLYTO_EQ_TO_ADDR(5.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 20:52:42 -0000 On Thu, 8 Nov 2018 21:32:09 +0100, Mateusz Piotrowski stated: >>>On Thu, 8 Nov 2018 18:13:24 +0000, Carmel NY wrote: =20 >>>> I am attempting to create an "rc" script to start a program I am worki= ng >>>> on. I want, if possible, for the user to enter something in the rc.con= f >>>> file to be added to the "command" string when the program is started. >>>>=20 >>>> EXAMPLE: >>>>=20 >>>> In the rc script, this is present >>>>=20 >>>> command=3D/usr/local/bin/MyProg >>>>=20 >>>> Now, suppose the user wanted to activate logging. They could modify th= e >>>> rc script and append an "-l" to the command string. However, I would >>>> rather they entered options in the rc.conf file =20 > >Don't you look for ${name}_flags (see rc.subr(8)). ${name}_flags Arguments to call command with. This is usually set in rc.conf(5), and not in the rc.d(8) script. The environment variable `flags' can be used to override this. That calls "command", it does not append a value to it. I receive an error that "eval" cannot handle it. I am going to try: load_rc_config_var name var Read the rc.conf(5) variable var for name and set in the current shell, using load_rc_config in a sub-shell to prevent unwanted side effects from other variable assignments. --=20 Carmel