From owner-freebsd-questions@freebsd.org Mon Jul 11 18:08:16 2016 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 32DC4B92F4B for ; Mon, 11 Jul 2016 18:08:16 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2C381A63 for ; Mon, 11 Jul 2016 18:08:15 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-96-167.dynamic.qsc.de [92.195.96.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 20AA03CCF4; Mon, 11 Jul 2016 20:08:06 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id u6BI86HE002414; Mon, 11 Jul 2016 20:08:06 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Mon, 11 Jul 2016 20:08:06 +0200 From: Polytropon To: Nikos Vassiliadis Cc: freebsd-questions@freebsd.org Subject: Re: jobs control in a /bin/sh script Message-Id: <20160711200806.14b4e22f.freebsd@edvax.de> In-Reply-To: <3b55e09b-13d3-bdf2-e366-2c798ca9c1d2@gmx.com> References: <930cbcd1-2345-8a55-1b87-1691f5aa09a1@gmx.com> <20160710175219.48ef1d1a.freebsd@edvax.de> <3b55e09b-13d3-bdf2-e366-2c798ca9c1d2@gmx.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) 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.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2016 18:08:16 -0000 On Sun, 10 Jul 2016 21:49:51 +0300, Nikos Vassiliadis wrote: > > > On 07/10/16 18:52, Polytropon wrote: > > JOBS=`jobs -p` > > Thank you, that would do what I want. It's rather strange that > the other construct doesn't work. But this workaround would do:) In case of a shell script, calling the "jobs" command will invoke an internal (shell builtin) command, and this one seems to be unable to use redirection. There also is the /usr/bin/jobs binary, but it doesn't seem to work as desired in the scripting context... -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...