When I install an application via sudo apt-get install application, there is a prompt indicating the amount of disk space the application will fill and asks whether or not I want to continue. To continue I would type y and enter.

当我通过sudo apt-get install应用程序安装应用程序时,会出现一个提示,指示应用程序将填充的磁盘空间量,并询问我是否要继续。要继续,我会键入y并输入。

If I put the command in a script, how can I have the y and enter execute automatically?

如果我将命令放在脚本中,我怎么能得到y并自动输入执行?

1 个解决方案

#1


1

You can either use yes to supply an infinite amount of y's:

您可以使用yes来提供无限量的y:

yes|sudo apt-get install ...

or you can use the -y flag for apt-get install

或者你可以使用-y标志进行apt-get安装

sudo apt-get -y install ...

Alternatively, you can use --force-yes with apt-get to force even potentially dangerous actions. (See man apt-get for more information about options to apt-get.)

或者,您可以使用--force-yes和apt-get强制执行甚至是潜在危险的操作。 (有关apt-get选项的更多信息,请参阅man apt-get。)

更多相关文章

  1. 如何发送一个字节(或字节)来测试在我的应用程序中监听的套接字?
  2. Bash脚本删除目录中多个文件名末尾的'x'字符数量?
  3. Bash脚本不删除给定目录中的文件
  4. Linux Shell脚本攻略
  5. 〖Linux〗使用Qt5.2.0开发Android的NDK应用程序
  6. Shell脚本创建linux用户帐户但密码出错
  7. 《LINUX SHELL脚本攻略》(Sarath Lakshman中文版带书签) 和 英文
  8. shell脚本let命令在windows下编辑后上传到Linux一直报错
  9. 使用Bash编写Linux Shell脚本-9. 参数和子壳

随机推荐

  1. 在SQL连接中需要帮助
  2. SQL - 如何在UNION查询中排序
  3. SQL文结果集起别名
  4. DRP系统中用户增删改查(分页)Model1模式
  5. 是否有.Net的动态Sql构建器库?
  6. 外网远程连接局域网内的多台SQL服务器,请
  7. PL/SQL中在package里定义的常量与在packa
  8. mysql随机取出若干条记录的实用方法
  9. 十万火急!如何远程复制sql2000数据库
  10. 求SQL语句,有没有周末上班的高手,给帮个忙