10.0 + pkgng

Polytropon freebsd at edvax.de
Sat Apr 19 16:00:38 UTC 2014

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".

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list