From original post @ http://analyticsblog.mecglobal.it/analytics-tools/bashr/ In the world of data analysis, the term automation runs hand in hand with the term “scripting”. There’s not the best programming language, only the most suitable to perform…
content [toc] bash scripts equivalent bash command to rename a bash variable/command alias fire='firefox' fire similar way is to set environment variable export fire=firefox however when you wish to use this variable, you need call it with a '$' $fir…
linux - Run bash script as daemon - Stack Overflow https://stackoverflow.com/questions/19233529/run-bash-script-as-daemon # By default Redis does not run as a daemon. Use 'yes' if you need it.# Note that Redis will write a pid file in /var/run/redis.…
Linux Bash Script loop shell 编程之流程控制 for 循环.while 循环和 until 循环 for var in item1 item2 ... itemN do command1 command2 ... commandN done for var in item1 item2 ... itemN; do command1; command2- done; refs http://www.imooc.com/learn/408 https://linuxize…
shell "" 保留$,`,\, 换行含义,‘’保留字面值 $(), ``用于命令替换 算术扩展如 $[1+1] for循环: for Host in host1, host2, host3; do echo $Host; done for Host in host{1,2,3}; do echo $Host; done for Host in host{1..3}; do echo $Host; done for Package in $(rpm -a | grep kernel)…
1. sed sed 是一种流编辑器,它是文本处理中非常常用的工具,能够完美的配合正则表达式使用,功能非常强大. mkdir playground touch test.txt echo "Hello world!" >> test.txt cat>test.txt<<EOF > i love you > my honey > be easy > last row > EOF 例如: 删除文档的第一行 sed -i '1d'…
1. copy the instance id from aws console to file 2. remove the , from file sed -i 's/,//g' file 3. get ip address list to file2 $ cat getip.sh #!/bin/bash for id in `cat file` do #echo $id >> file2 aws ec2 describe-instances --instance-ids $id | gre…