摘要:#!/bin/shHOSTNAME="localhost" #数据库信息PORT="3306"USERNAME="root"PASSWORD="guojunjie"#数据库名称DBNAME="bank" TABLENAME="user" #两个标记,用于判断是否超过输入flag=1flag1=1#输入帐号密码成功后进行接下来操作main(){echo "Please input what do yo...
阅读全文
摘要:关于perl处理my数据库的一些内容,看到书也不太了解,还好有文档。还是文档好。查看文档,在终端中输入:perldoc DBD::mysql1 #!/usr/bin/perl -w 2 use DBI; 3 my $database="datebasename"; 4 my $hostname="localhost"; 5 my $port="3306"; 6 my $user="username"; 7 my $password="password"; 8 $dsn = "DBI:m
阅读全文
摘要:#!/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()
{ 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
阅读全文