# pkg - getting input from a file



## balanga (Feb 8, 2017)

How do I input a pkgname to pkg from a file?

I've tried:-

`cat temp | pkg install -

pkg install <temp`

???


----------



## tobik@ (Feb 8, 2017)

`xargs pkg install < temp`


----------



## SirDice (Feb 8, 2017)

tobik said:


> `xargs pkg install < temp`


xargs(1) is such a handy tool for situations like this


----------



## balanga (Feb 8, 2017)

tobik said:


> `xargs pkg install < temp`



Nice to know about xargs...... but how do I confirm that I want to proceed with this action which needs 'y' to be entered?


----------



## SirDice (Feb 8, 2017)

`env ASSUME_ALWAYS_YES=true pkg install -y <packagename>`


----------

