From owner-freebsd-questions@FreeBSD.ORG Sat Apr 19 16:00:38 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C98F7F13 for ; Sat, 19 Apr 2014 16:00:38 +0000 (UTC) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.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 8D1E21E81 for ; Sat, 19 Apr 2014 16:00:38 +0000 (UTC) Received: from r56.edvax.de (port-92-195-108-40.dynamic.qsc.de [92.195.108.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id AC842249AF; Sat, 19 Apr 2014 18:00:35 +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 s3JFxRNo003089; Sat, 19 Apr 2014 17:59:27 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 19 Apr 2014 17:59:27 +0200 From: Polytropon To: Fbsd8 Subject: Re: 10.0 + pkgng Message-Id: <20140419175927.ce9a0b83.freebsd@edvax.de> In-Reply-To: <53529B92.1070909@a1poweruser.com> References: <53529B92.1070909@a1poweruser.com> 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 Cc: FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 16:00:38 -0000 On Sat, 19 Apr 2014 11:51:46 -0400, Fbsd8 wrote: > The handbook says to activate pkgng on a newly installed 10.0 system by > first executeing /usr/sbin/pkg followed by pkg2ng. Both these programs > issue message that you have to enter [y or n] to continue. I want to > bury these commands in a script. There is no -y flag to bypass that > message. What is best method to code script to answer "y" to automate > script processing? The answer is "yes". See "man yes" for details. Probably you can use something like yes | pkg yes | pkg2ng Other options are maybe "echo y | " if there is no -y for the program itself. However, this should not be needed for all pkg operations. For example, "pkg install" offers a -y option: -y Assume yes when asked for confirmation before package installation. It also honors the ASSUME_ALWAYS_YES setting in pkg.conf. See "man pkg-install" for details. Note that the different operations pkg can perform all have their own manpage. They are listed in the "SEE ALSO" section of "man pkg". -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...