摘要:#!/bin/shHOSTNAME="localhost" #数据库信息PORT="3306"USERNAME="root"PASSWORD=""#数据库名称DBNAME="bank" TABLENAME="user" #两个标记,用于判断是否超过输入flag=1flag1=1#输入帐号密码成功后进行接下来操作main(){echo "Please input what do you want to...
阅读全文
摘要:#!/bin/shecho -n "" >filefor dir in $( ls ) do time'=` date +%Y%m%d%H%M%S -r $dir ` echo "$time $dir" >>file done sort -n -k 1 file
阅读全文
摘要:1、 [guo@localhost ~]$ cat ssss1234abb[guo@localhost ~]$ cat ssss |sed 's/[[:digit:]]//g'abbsed 's/[[:digit:]]//g' 提取数字和字符串组合后边的字符串 如12234ads执行输出ads2、[guo@localhost ~]$ cat ssss1234abb[guo@localhost ~]$ cat ssss | sed 's/[1-9]//g'abb
阅读全文
摘要:#!/bin/shecho -n "Please enter the number of person from the server :"read numn=`tail -n1 shuchu` if [ $n -eq $num ] ; then echo $num >> shuchu else echo $num >shuchu fim=`wc -l shuchu|awk '{print $1}'` if [ $m -ge 5 ] && [ $m -le 20 ] ; then if [ $n -eq 0 ] then e
阅读全文
摘要:#!/bin/sh directory()
{ for file in $( ls ./qq ) do cat ./qq/$file | while read line do sed -n '/'$line'/p' ./passwd >> ./jieguo/$file done
# sort /home/guo/debug |uniq > /home/guo/debug.txt done
}
directory
阅读全文
摘要:#!/bin/sh
directory()
{ let "filenum = 0 " let "dirnum = 0 " ls $1 echo "" for dir in $( ls ) do if [ -d $dir ] then let "dirnum+=1" else let "filenum+=1" fi done echo "The number of directories is $dirnum " echo "The number of files i
阅读全文