Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将文件中的文本字符串放在命令的末尾?
我想要的是使用sudo dpkg -i或|或<(>或其他任何东西)来输入字符串file,其中将是包名称。为了证明它:
sudo dpkg -i
|
<
>
file
$ ls file pkg1.deb pkg2.deb pkg3.deb pkg4.deb $ more file pkg1.deb pkg3.deb $ sudo dpkg -i < file
并且应该运行所选软件包的安装。
信息:我使用的是 Ubuntu 13.10 i386
$ sudo dpkg -i $(<file)
应该可以工作,假设 dpkg -i 可以采用多个包名称(周围没有 debian 框可以检查)。如果不:
for X in $(<file) ; do sudo dpkg -i "$X" ; done