From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1699 Path: news.gmane.org!not-for-mail From: Robin Bowes Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Help with chpst -e Date: Mon, 14 Apr 2008 00:52:25 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1208130742 23286 80.91.229.12 (13 Apr 2008 23:52:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Apr 2008 23:52:22 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1934-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Apr 14 01:53:00 2008 connect(): Connection refused Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.50) id 1JlC0J-0001hr-3l for gcsg-supervision@gmane.org; Mon, 14 Apr 2008 01:52:59 +0200 Original-Received: (qmail 17215 invoked by uid 76); 13 Apr 2008 23:52:41 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 17207 invoked from network); 13 Apr 2008 23:52:41 -0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 84-51-160-74.pambow882.adsl.metronet.co.uk User-Agent: Thunderbird 2.0.0.12 (X11/20080226) In-Reply-To: X-Enigmail-Version: 0.95.6 Original-Sender: news Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1699 Archived-At: Robin Bowes wrote: > Hi, > > Is it possible to set vars using "chpst -e" and then use those vars > later in the same command line? > > e.g. > > mkdir env > echo dnslog > env/LOGUSER > echo /var/log/dnscache > env/LOGDIR > > Then in run: > #!/bin/sh > exec chpst -e ./env -u $LOGUSER svlogd -tt $LOGDIR > > I realise that this specific example won't work - $LOGUSER and $LOGDIR > will both retain the values they had when the script was launched. > > Is what I describe above possible? Answer: yes it is. This works: #!/bin/sh exec \ chpst -e ./env sh -c ' chpst -u ${LOGUSER} \ svlogd -tt ${LOGDIR} ' LOGUSER and LOGDIR are set in ./env R.