随笔分类 -  shell

上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要:#!/bin/bash #java environment variables Base_Path=$(cd `dirname $0`; pwd) echo $Base_Path JAVA_HOME=$Base_Path/jdk1.8.0_131 echo $JAVA_HOME JAVA_BIN=$Base_Path/jdk1.8.0_131/bin echo $JAVA_BIN PATH=$PA 阅读全文
posted @ 2019-08-29 16:52 anobscureretreat 阅读(349) 评论(0) 推荐(0)
摘要:参考: 网站 stackoverflow 以及segmentfault。 阅读全文
posted @ 2019-08-26 18:15 anobscureretreat 阅读(21111) 评论(0) 推荐(0)
摘要:#!/bin/sh a=`uname -a` b="Darwin" c="centos" d="ubuntu" if [[ $a =~ $b ]];then echo "mac" elif [[ $a =~ $c ]];then echo "centos" elif [[ $a =~ $d ]];then echo "ubuntu" else echo $a fi 阅读全文
posted @ 2019-08-26 18:03 anobscureretreat 阅读(5329) 评论(3) 推荐(0)
摘要:awk 方式 利用${#str}来获取字符串的长度 wc 方式(注意是包含换行符的) 参考: https://www.jb51.net/article/121290.htm 阅读全文
posted @ 2019-08-23 23:44 anobscureretreat 阅读(327) 评论(0) 推荐(0)
摘要:test.sh 输出 参考: https://www.jb51.net/article/121290.htm 阅读全文
posted @ 2019-08-23 23:35 anobscureretreat 阅读(1162) 评论(0) 推荐(0)
摘要:输出 还可以写成 或者 参考: https://blog.csdn.net/u010003835/article/details/80750003 阅读全文
posted @ 2019-08-23 23:31 anobscureretreat 阅读(23074) 评论(0) 推荐(0)
摘要:default.yaml test.sh 输出 参考: https://www.cnblogs.com/chengmo/archive/2010/10/02/1841355.html 阅读全文
posted @ 2019-08-23 23:23 anobscureretreat 阅读(904) 评论(0) 推荐(0)
摘要:参考: https://www.cnblogs.com/faithfu/p/9472817.html 阅读全文
posted @ 2019-08-23 23:10 anobscureretreat 阅读(226) 评论(0) 推荐(0)
摘要:输出 参考: https://www.runoob.com/linux/linux-shell-variable.html 阅读全文
posted @ 2019-08-23 23:08 anobscureretreat 阅读(206) 评论(0) 推荐(0)
摘要:test.sh 输出 阅读全文
posted @ 2019-08-23 23:03 anobscureretreat 阅读(2013) 评论(0) 推荐(0)
摘要:test.sh: 输出 参考: https://www.runoob.com/linux/linux-shell-variable.html 阅读全文
posted @ 2019-08-23 23:01 anobscureretreat 阅读(447) 评论(0) 推荐(0)
摘要:test.sh 输出 参考: https://runoob.com/linux/linux-shell-variable.html 阅读全文
posted @ 2019-08-23 22:58 anobscureretreat 阅读(237) 评论(0) 推荐(0)
摘要:参考: https://blog.csdn.net/bcfdsagbfcisbg/article/details/78603781 阅读全文
posted @ 2019-08-23 22:54 anobscureretreat 阅读(2147) 评论(0) 推荐(0)
摘要:输出 参考: 阅读全文
posted @ 2019-08-23 22:40 anobscureretreat 阅读(5584) 评论(0) 推荐(0)
摘要:使用CURL时,有两个超时时间:一个是连接超时时间,另一个是数据传输的最大允许时间。连接超时时间用--connect-timeout参数来指定,数据传输的最大允许时间用-m参数来指定。 连接超时的话,出错提示形如:curl: (28) connect() timed out!数据传输的最大允许时间超 阅读全文
posted @ 2019-08-23 21:58 anobscureretreat 阅读(16907) 评论(0) 推荐(0)
摘要:[admin@localhost file]$ cat file hello 0 hello 1 hello 2 hello 3 hello 4 [admin@localhost file]$ cat test.sh #!/bin/bash while read line do echo 'buy '$line done < file >> file_b [admin@localhost file 阅读全文
posted @ 2019-08-23 01:13 anobscureretreat 阅读(1870) 评论(0) 推荐(0)
摘要:使用.或者source api.sh test.sh 输出 阅读全文
posted @ 2019-08-23 00:58 anobscureretreat 阅读(137) 评论(0) 推荐(0)
摘要:test.sh 输出 阅读全文
posted @ 2019-08-23 00:52 anobscureretreat 阅读(3583) 评论(0) 推荐(0)
摘要:test.sh 输出 阅读全文
posted @ 2019-08-22 20:22 anobscureretreat 阅读(286) 评论(0) 推荐(0)
摘要:test.sh: echo -e "hello w\norld!"echo -e "hello w\c"echo "orld!" 输出 bogon:Desktop macname$ ./test.shhello world!hello world! 阅读全文
posted @ 2019-08-22 20:12 anobscureretreat 阅读(3794) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 ··· 10 下一页