摘要:
转载自:http://blog.chinaunix.net/uid-20147410-id-3206364.html安装了ssh服务,但是不希望他开机自动启动,可以如下设置: 在/etc/init/ssh.conf中,找到start on filesystem or runlevel [2345] ... 阅读全文
随笔分类 - shell脚本学习
bash shell脚本之使用expr运算
2015-01-22 15:18 by 雪夜&流星, 361 阅读, 收藏, 编辑
摘要:
bash shell中的数学运算cat test7:#!/bin/bash# An example of using the expr commandvar1=10var2=20var3=`expr $var2 / $var1`echo The result is $var3添加可执行权限:chmo... 阅读全文
bash shell脚本之获取时间日期
2015-01-22 15:15 by 雪夜&流星, 1495 阅读, 收藏, 编辑
摘要:
shell中的时间日期获取cat test5:#!/bin/bash# using the backtick charactertesting=`date`echo "The date and time are:" $testingdate=`date +%Y-%m-%d_%H-%M-%S` ech... 阅读全文
bash shell脚本之成员变量
2014-10-15 21:02 by 雪夜&流星, 207 阅读, 收藏, 编辑
摘要:
shell中变量的使用cat test3:#!/bin/bash# testing variablesdays=10guest="Katie"echo "$guest checked in $days days ago"days=5guest="Jessica"echo "$guest checke... 阅读全文
bash shell脚本之查看系统环境变量
2014-10-15 20:59 by 雪夜&流星, 1240 阅读, 收藏, 编辑
摘要:
查看当前系统环境变量cat test2:#!/bin/bash# display user information from the system.echo "User info for userid:$USER"echo UID:$UIDecho HOME:$HOME添加执行权限:chmod u+... 阅读全文
bash shell脚本之查看当前日期以及登陆用户
2014-10-15 20:56 by 雪夜&流星, 264 阅读, 收藏, 编辑
摘要:
查看当前日期以及登陆用户:cat test1: #!/bin/bash # This script displays the date and who's logged on echo -n The time and date are: date echo "Let's see who's... 阅读全文