Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Apr 2014 17:59:27 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Fbsd8 <fbsd8@a1poweruser.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: 10.0 + pkgng
Message-ID:  <20140419175927.ce9a0b83.freebsd@edvax.de>
In-Reply-To: <53529B92.1070909@a1poweruser.com>
References:  <53529B92.1070909@a1poweruser.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 | <program>" 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, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140419175927.ce9a0b83.freebsd>