
shell
xxgxgx
这个作者很懒,什么都没留下…
展开
-
shell基本语法及应用
语法if[ $var -eq 0 ] && action;-gt :大于-lt: 小于-ge: 大于等于-le: 小于等于-a: 逻辑与-o: 逻辑或字符串的比较,最好使用双中括号[[ $str1 == $str2 ]][[ $str != $str ]]支持 > 、 <判空:-z 非空: -nif更友好:if [[ -n $str ]] && [[ -z $str2 ]];转载 2016-04-01 15:49:59 · 354 阅读 · 0 评论 -
linux下ntp对时设置
1、首先在 /etc/profile 中添加环境变量: ntp=/mnt export ntp PATH=$PATH:$HOME:$ntp: export PATH2、在开发板上ping www.baidu.com,查看网络通信是否正常;如果ping不同,用ifconfig查看IP地址,MAC地址,网关等信息;可以在系统下加上”udhcpc -i eth0 ” –自动获取IP,重启系统原创 2016-04-11 15:05:24 · 11036 阅读 · 0 评论 -
shell编写简单的CGI脚本
用shell编写的简单的cgi脚本简单程序:#!/bin/sh#test1.cgiecho "Content-Type:text/html\n\n"echo ""echo ""echo "hello!"echo "br"echo "the time is:"echo "br"date保存为test1.cgi并将文件放在boa配置文件设定的cgi路径下比如/www/cgi-bin原创 2016-07-10 21:44:00 · 3478 阅读 · 0 评论 -
Linux下开机启动脚本 etc rcS 环境变量 pid判断
#Linux下开机启动脚本/etc/init.d/rcS#!/bin/sh#echo "hello pqm"insmod /pqm/ko/clock_2401_dev.koinsmod /pqm/ko/clock_2401_drv.ko/pqm/ipcfg/ipconfig_eth0.sh/pqm/ipcfg/ipconfig_eth1.shulimit -s 4096BFS_ROOT=/h原创 2016-07-10 21:46:15 · 2324 阅读 · 0 评论 -
date -s 修改时间
date -s “2016-4-18 15:14:23” char itmp1[5],itmp2[5],itmp3[5],itmp4[5],itmp5[5],itmp6[5]; itmp1 = atoi(tmp1); itmp2 = atoi(tmp2); itmp3 = atoi(tmp3); itmp4 = atoi(tmp4); itmp5 = at原创 2016-07-10 21:46:57 · 26773 阅读 · 0 评论