随笔分类 -  shell

sh 学习
摘要:当编译好程序后,就需要启动测试程序,为了方便,我们一般使用脚本来拉起启动程序。 写个测试程序testMain, 写个拉起脚本run.sh #!/bin/sh #Check program is running count=`ps -ef | grep './bin/testMain' | grep 阅读全文
posted @ 2019-08-20 17:47 小菜77 阅读(927) 评论(0) 推荐(0)
摘要:#!/user/bin/ksh. ~/.profile############################################################## zip file to remote host##################################### 阅读全文
posted @ 2018-11-04 11:33 小菜77 阅读(222) 评论(0) 推荐(0)
摘要:1.Linux shell 截取字符变量的前8位 实现方法有如下几种: 2.按指定的字符串截取 (1)第一种方法:从左向右截取最后一个string后的字符串${varible##*string}从左向右截取第一个string后的字符串${varible#*string}从右向左截取最后一个strin 阅读全文
posted @ 2017-11-12 17:56 小菜77 阅读(5703) 评论(0) 推荐(0)
摘要:shell实例手册 0说明{ 手册制作: 雪松 更新日期: 2013-12-06 欢迎系统运维加入Q群: 198173206 请使用"notepad++"打开此文档,"alt+0"将函数折叠后方便查阅 请勿删除信息,转载请说明出处,抵制不道德行为。 错误在所难免,还望指正! # shell实例手册最新下载地址: http:/... 阅读全文
posted @ 2016-11-22 23:22 小菜77 阅读(10806) 评论(0) 推荐(0)
摘要:一.查看文件编码 file name;//可以显现文件的编码格式(有的系统不可以) 二.文件编码转换 使用iconv转换, iconv -f encoding -t encoding inputfile; 例如:iconv -f utf-8 -t gb2312 file1; 用法:iconv [选项 阅读全文
posted @ 2016-11-22 21:51 小菜77 阅读(3974) 评论(0) 推荐(0)
摘要:1.用-s判断时间是否为NULL ############################### echo "Begin to check file" #for i in `ls *|awk -F '.' '{print $1}'` //获取文件名(不带后缀) #获取循环获取文件名 for i in 阅读全文
posted @ 2016-05-04 16:50 小菜77 阅读(361) 评论(0) 推荐(0)
摘要:. ~/.profile ############################## # FTP Data files ############################## #remote dir REMOTEDIR="/home/cheyang/" #local dir LOCALDIR 阅读全文
posted @ 2016-05-04 16:37 小菜77 阅读(373) 评论(0) 推荐(0)