bash

How can I run bash in a new container of a docker image?

老子叫甜甜 提交于 2021-02-15 08:35:57
问题 I am able to run arbitrary shell commands in a container created from docker/whalesay image. $ docker run docker/whalesay ls -l total 56 -rw-r--r-- 1 root root 931 May 25 2015 ChangeLog -rw-r--r-- 1 root root 385 May 25 2015 INSTALL -rw-r--r-- 1 root root 1116 May 25 2015 LICENSE -rw-r--r-- 1 root root 445 May 25 2015 MANIFEST -rw-r--r-- 1 root root 1610 May 25 2015 README -rw-r--r-- 1 root root 879 May 25 2015 Wrap.pm.diff drwxr-xr-x 2 root root 4096 May 25 2015 cows -rwxr-xr-x 1 root root

How can I run bash in a new container of a docker image?

坚强是说给别人听的谎言 提交于 2021-02-15 08:35:10
问题 I am able to run arbitrary shell commands in a container created from docker/whalesay image. $ docker run docker/whalesay ls -l total 56 -rw-r--r-- 1 root root 931 May 25 2015 ChangeLog -rw-r--r-- 1 root root 385 May 25 2015 INSTALL -rw-r--r-- 1 root root 1116 May 25 2015 LICENSE -rw-r--r-- 1 root root 445 May 25 2015 MANIFEST -rw-r--r-- 1 root root 1610 May 25 2015 README -rw-r--r-- 1 root root 879 May 25 2015 Wrap.pm.diff drwxr-xr-x 2 root root 4096 May 25 2015 cows -rwxr-xr-x 1 root root

apt-get install tzdata noninteractive

与世无争的帅哥 提交于 2021-02-15 08:34:04
问题 When I try to apt-get install -y tzdata the command line option for picking timezone shows up. I am trying to use this in a script to do some setup, how can I make the apt-get run without user input? I know to reconfigure the tzdata I can do echo "America/New_York" > /etc/timezone dpkg-reconfigure -f noninteractive tzdata But when installing I need it to run fully even if it doesn't set the right timezone, I can always reconfigure it. I tried echo 5 | apt-get install -y tzdata but it is not

apt-get install tzdata noninteractive

a 夏天 提交于 2021-02-15 08:26:11
问题 When I try to apt-get install -y tzdata the command line option for picking timezone shows up. I am trying to use this in a script to do some setup, how can I make the apt-get run without user input? I know to reconfigure the tzdata I can do echo "America/New_York" > /etc/timezone dpkg-reconfigure -f noninteractive tzdata But when installing I need it to run fully even if it doesn't set the right timezone, I can always reconfigure it. I tried echo 5 | apt-get install -y tzdata but it is not

apt-get install tzdata noninteractive

我是研究僧i 提交于 2021-02-15 08:25:22
问题 When I try to apt-get install -y tzdata the command line option for picking timezone shows up. I am trying to use this in a script to do some setup, how can I make the apt-get run without user input? I know to reconfigure the tzdata I can do echo "America/New_York" > /etc/timezone dpkg-reconfigure -f noninteractive tzdata But when installing I need it to run fully even if it doesn't set the right timezone, I can always reconfigure it. I tried echo 5 | apt-get install -y tzdata but it is not

apt-get install tzdata noninteractive

谁说我不能喝 提交于 2021-02-15 08:24:59
问题 When I try to apt-get install -y tzdata the command line option for picking timezone shows up. I am trying to use this in a script to do some setup, how can I make the apt-get run without user input? I know to reconfigure the tzdata I can do echo "America/New_York" > /etc/timezone dpkg-reconfigure -f noninteractive tzdata But when installing I need it to run fully even if it doesn't set the right timezone, I can always reconfigure it. I tried echo 5 | apt-get install -y tzdata but it is not

Instead using awk in for loop in bash through all files - do something only in awk

大城市里の小女人 提交于 2021-02-15 07:37:18
问题 I have a question. This is my input file. #!/bin/bash name="eq6" tmp=$(mktemp) || exit 1 for index in {1..2} do awk 'f;/hbonds_Other-SOL/{f=1}' "${name}_$index.ndx" > "$tmp" && mv "$tmp" "${name}_$index.ndx" done Is it possible do this only in awk? I don't want to call awk in every for loop. This is my input eq6_1.ndx 98536 98539 98542 98545 98548 [ hbonds_Other-SOL ] 8 9 76759 eq6_2.ndx 98542 98545 98548 [ hbonds_Other-SOL ] 8 9 65281 Expected output - print all lines from all files which

Instead using awk in for loop in bash through all files - do something only in awk

我与影子孤独终老i 提交于 2021-02-15 07:37:10
问题 I have a question. This is my input file. #!/bin/bash name="eq6" tmp=$(mktemp) || exit 1 for index in {1..2} do awk 'f;/hbonds_Other-SOL/{f=1}' "${name}_$index.ndx" > "$tmp" && mv "$tmp" "${name}_$index.ndx" done Is it possible do this only in awk? I don't want to call awk in every for loop. This is my input eq6_1.ndx 98536 98539 98542 98545 98548 [ hbonds_Other-SOL ] 8 9 76759 eq6_2.ndx 98542 98545 98548 [ hbonds_Other-SOL ] 8 9 65281 Expected output - print all lines from all files which

PetaLinux安装

[亡魂溺海] 提交于 2021-02-14 20:29:45
名称 开发者 版本号 日期 PetaLinux安装 LC V1.0 2019-04-03 所有安装软件均在 Ubuntu16.04 下进行,这也是 ug1144 手册经过验证的系统。 一、安装要求 主机环境 8 GB RAM (recommended minimum for Xilinx tools) 2 GHz CPU clock or equivalent (minimum of 8 cores) 100 GB free HDD space Supported OS: Ubuntu Linux 16.04.3, 16.04.4 (64-bit) CentOS 7.2, 7.3, 7.4, 7.5 (64-bit) PetaLinux工具要求主机系统 /bin/sh is bash. If you are using Ubuntu distribution and your /bin/sh is dash, consult your system administrator to change your default host system /bin/sh with the sudo dpkg-reconfigure dash command.具体操作如下 在终端输入 1 、$ sudo dpkg-reconfigure dash 2 、在弹出的界面选择“否”,禁用dash 3

Shell脚本学习--函数

霸气de小男生 提交于 2021-02-14 20:09:33
05- Shell脚本学习--函数 标签: Shell [TOC] 函数可以让我们将一个复杂功能划分成若干模块,让程序结构更加清晰,代码重复利用率更高。像其他编程语言一样,Shell 也支持函数。Shell 函数必须先定义后使用。 函数定义 Shell 函数的定义格式如下: function function_name () { list of commands [ return value ] } 其中 function 关键字是可选的。 #!/bin/bash hello(){ echo 'hello'; } hello 运行结果: hello 调用函数只需要给出函数名,不需要加括号。 函数返回值,可以显式增加return语句;如果不加,会将最后一条命令运行结果作为返回值。 Shell 函数返回值只能是整数,一般用来表示函数执行成功与否,0表示成功,其他值表示失败。如果 return 其他数据,比如一个字符串,往往会得到错误提示: numeric argument required 。 #!/bin/bash function hello(){ return 'hello'; } hello 运行结果: line 4: return: hello: numeric argument required 如果一定要让函数返回字符串,那么可以先定义一个变量,用来接收函数的计算结果