Shell文件操作-实战篇

阅读更多

         下面是关于shell文件操作常用的使用

 

1.创建文件夹
#!/bin/sh
mkdir -m 777 "%%1"

2.创建文件
#!/bin/sh
touch "%%1"

3.删除文件
#!/bin/sh
rm -if "%%1"

4.删除文件夹
#!/bin/sh
rm -rf "%%1"

5.删除一个目录下所有的文件夹
#!/bin/bash
direc="%%1" #$(pwd)
for dir2del in $direc/* ; do
if [ -d $dir2del ]; then
  rm -rf $dir2del
fi
done

6.清空文件夹
#!/bin/bash
direc="%%1" #$(pwd)
rm -if $direc/*
for dir2del in $direc/* ; do
if [ -d $dir2del ]; then
  rm -rf $dir2del
fi
done

7.读取文件
#!/bin/sh
7.1.操作系统默认编码
cat "%%1" | while read line; do
echo $line;
done

7.2.UTF-8编码
cat "%%1" | while read line; do
echo $line;
done

7.3.分块读取
cat "%%1" | while read line; do
echo $line;
done

8.写入文件
#!/bin/sh
cat > "%%1" << EOF
%%2
EOF

tee "%%1" > /dev/null << EOF
%%2
EOF

#sed -i '$a %%2' %%2

9.写入随机文件
#!/bin/sh
cat > "%%1" << EOF
%%2
EOF

tee "%%1" > /dev/null << EOF
%%2
EOF

#sed -i '$a %%2' %%2

10.读取文件属性
#!/bin/bash
file=%%1
file=${file:?'必须给出参数'}
if [ ! -e $file ]; then
    echo "$file 不存在"
    exit 1
fi
if [ -d $file ]; then
    echo "$file 是一个目录"
    if [ -x $file ]; then
        echo "可以"
    else
        echo "不可以"
    fi
    echo "对此进行搜索"  
elif [ -f $file ]; then
    echo "$file 是一个正规文件"
else
    echo "$file不是一个正规文件"
fi
if [ -O $file ]; then
    echo "你是$file的拥有者"
else
    echo "你不是$file的拥有者"
fi
if [ -r $file ]; then
    echo "你对$file拥有"
else
    echo "你并不对$file拥有"
fi
echo "可读权限"
if [ -w $file ]; then
    echo "你对$file拥有"
else
    echo "你并不对$file拥有"
fi
echo "可写权限"
if [ -x $file -a ! -d $file ]; then
    echo "你拥有对$file"
else
    echo "你并不拥有对$file"
fi
echo "可执行的权限"

11.写入文件属性
#!/bin/bash
#修改存放在ext2、ext3、ext4、xfs、ubifs、reiserfs、jfs等文件系统上的文件或目录属性,使用权限超级用户。
#一些功能是由Linux内核版本来支持的,如果Linux内核版本低于2.2,那么许多功能不能实现。同样-D检查压缩文件中的错误的功能,需要2.5.19以上内核才能支持。另外,通过chattr命令修改属性能够提高系统的安全性,但是它并不适合所有的目录。chattr命令不能保护/、/dev、/tmp、/var目录。
chattr [-RV] [-+=AacDdijsSu] [-v version] 文件或目录
  -R:递归处理所有的文件及子目录。
  -V:详细显示修改内容,并打印输出。
  -:失效属性。
  +:激活属性。
  = :指定属性。
  A:Atime,告诉系统不要修改对这个文件的最后访问时间。
  S:Sync,一旦应用程序对这个文件执行了写操作,使系统立刻把修改的结果写到磁盘。
  a:Append Only,系统只允许在这个文件之后追加数据,不允许任何进程覆盖或截断这个文件。如果目录具有这个属性,系统将只允许在这个目录下建立和修改文件,而不允许删除任何文件。
  i:Immutable,系统不允许对这个文件进行任何的修改。如果目录具有这个属性,那么任何的进程只能修改目录之下的文件,不允许建立和删除文件。
  D:检查压缩文件中的错误。
  d:No dump,在进行文件系统备份时,dump程序将忽略这个文件。
  C:Compress,系统以透明的方式压缩这个文件。从这个文件读取时,返回的是解压之后的数据;而向这个文件中写入数据时,数据首先被压缩之后才写入磁盘。
  S:Secure Delete,让系统在删除这个文件时,使用0填充文件所在的区域。
  u:Undelete,当一个应用程序请求删除这个文件,系统会保留其数据块以便以后能够恢复删除这个文件。

12.枚举一个目录中的所有文件夹
#!/bin/bash
OLDIFS=$IFS
IFS=:
for path in $( find "%%1" -type d -printf "%p$IFS")
do
#"$path"
done
IFS=$OLDIFS

13.复制文件夹
#!/bin/sh
cp -rf "%%1" "%%2"

14.复制一个目录下所有的文件夹到另一个目录下
#!/bin/bash
direc="%%1" #$(pwd)
for dir2cp in $direc/* ; do
if [ -d $dir2cp ]; then
  cp $dir2cp "%%2"
fi
done

15.移动文件夹
#!/bin/sh
mv -rf "%%1" "%%2"

16.移动一个目录下所有的文件夹到另一个目录下
#!/bin/bash
direc="%%1" #$(pwd)
for dir2mv in $direc/* ; do
if [ -d $dir2mv ]; then
  mv $dir2mv "%%2"
fi
done

17.以一个文件夹的框架在另一个目录下创建文件夹和空文件
#!/bin/bash
direc="%%1" #$(pwd)
OLDIFS=$IFS
IFS=:
for path in $( find $direc -type d -printf "%p$IFS")
do
mkdir -p "%%2/${path:${#direc}+1}"
done
IFS=$OLDIFS
#cp -a "%%1" "%%2"

表达式 含义
${#string}
{#string}
1,取得字符串长度
string=abc12342341          //等号二边不要有空格
echo ${#string}             //结果11
expr length $string         //结果11
expr "$string" : ".*"       //结果11 分号二边要有空格,这里的:根match的用法差不多2,字符串所在位置
expr index $string '123'    //结果4 字符串对应的下标是从0开始的这个方法让我想起来了js的indexOf,各种语言对字符串的操作方法大方向都差不多,如果有语言基础的话,学习shell会很快的。
3,从字符串开头到子串的最大长度
expr match $string 'abc.*3' //结果9个人觉得这个函数的用处不大,为什么要从开头开始呢。
4,字符串截取
echo ${string:4}      //2342341  从第4位开始截取后面所有字符串
echo ${string:3:3}    //123      从第3位开始截取后面3位
echo ${string:3:6}    //123423   从第3位开始截取后面6位
echo ${string: -4}    //2341  :右边有空格   截取后4位
echo ${string:(-4)}   //2341  同上
expr substr $string 3 3   //123  从第3位开始截取后面3位上面的方法让我想起了,php的substr函数,后面截取的规则是一样的。
5,匹配显示内容
//例3中也有match和这里的match不同,上面显示的是匹配字符的长度,而下面的是匹配的内容
expr match $string '\([a-c]*[0-9]*\)'  //abc12342341
expr $string : '\([a-c]*[0-9]\)'       //abc1
expr $string : '.*\([0-9][0-9][0-9]\)' //341 显示括号中匹配的内容这里括号的用法,是不是根其他的括号用法有相似之处呢,
6,截取不匹配的内容
echo ${string#a*3}     //42341  从$string左边开始,去掉最短匹配子串
echo ${string#c*3}     //abc12342341  这样什么也没有匹配到
echo ${string#*c1*3}   //42341  从$string左边开始,去掉最短匹配子串
echo ${string##a*3}    //41     从$string左边开始,去掉最长匹配子串
echo ${string%3*1}     //abc12342  从$string右边开始,去掉最短匹配子串
echo ${string%%3*1}    //abc12     从$string右边开始,去掉最长匹配子串这里要注意,必须从字符串的第一个字符开始,或者从最后一个开始,
7,匹配并且替换
echo ${string/23/bb}   //abc1bb42341  替换一次
echo ${string//23/bb}  //abc1bb4bb41  双斜杠替换所有匹配
echo ${string/#abc/bb} //bb12342341   #以什么开头来匹配,根php中的^有点像
echo ${string/%41/bb}  //abc123423bb  %以什么结尾来匹配,根php中的$有点像

#!/bin/bash
direc=$(pwd)
for file in "$(direc)/*"
do
if [ "${file##*.}" = "sh" ]; then
xterm -e bash $file
elif [ "${file##*.}" = "bin" ]; then
xterm -e $file
elif [ "${file##*.}" = "run" ]; then
xterm -e $file
elif [ "${file##*.}" = "bundle" ]; then
xterm -e $file
elif [ "${file##*.}" = "pl" ]; then
xterm -e perl $file
elif [ "${file##*.}" = "class" ]; then
xterm -e java ${file%.*}
elif [ "${file##*.}" = "rpm" ]; then
xterm -e rpm -ivh $file
elif [ "${file##*.}" = "rb" ]; then
xterm -e ruby $file
elif [ "${file##*.}" = "py" ]; then
xterm -e python $file
elif [ "${file##*.}" = "jar" ]; then
xterm -e java -jar $file
fi
done
OLDIFS=$IFS
IFS=:
for path in $( find $direc -type d -printf "%p$IFS")
do
for file in `ls $path`
do
if [ "${file##*.}" = "sh" ]; then
xterm -e bash """"$path"/"$file""""
elif [ "${file##*.}" = "bin" ]; then
xterm -e """"$path"/"$file""""
elif [ "${file##*.}" = "run" ]; then
xterm -e """"$path"/"$file""""
elif [ "${file##*.}" = "bundle" ]; then
xterm -e """"$path"/"$file""""
elif [ "${file##*.}" = "pl" ]; then
xterm -e perl """"$path"/"$file""""
elif [ "${file##*.}" = "class" ]; then
xterm -e java """"$path"/"${file%.*}""""
elif [ "${file##*.}" = "rpm" ]; then
xterm -e rpm -ivh """"$path"/"$file""""
elif [ "${file##*.}" = "rb" ]; then
xterm -e ruby """"$path"/"$file""""
elif [ "${file##*.}" = "py" ]; then
xterm -e python """"$path"/"$file""""
elif [ "${file##*.}" = "jar" ]; then
xterm -e java -jar """"$path"/"$file""""
fi
done
done
IFS=$OLDIFS

18.复制文件
#!/bin/sh
cp %%1 %%2

19.复制一个目录下所有的文件到另一个目录
#!/bin/bash
direc="%%1" $(pwd)
for file in "$direc/*"
do
cp "$file" "%%1"
done

20.提取扩展名
#!/bin/sh
%%2=${%%1##.}

21.提取文件名
#!/bin/sh
%%2="$(basename %%1)"

22.提取文件路径
#!/bin/sh
%%2="$(dirname %%1)"

23.替换扩展名
#!/bin/sh
%%3="$(basename %%1)$%%2"

24.追加路径
#!/bin/sh
%%3="$(dirname %%1)/$%%2"

25.移动文件
#!/bin/sh
mv "%%1" "%%2"

26.移动一个目录下所有文件到另一个目录
#!/bin/bash
direc="%%1" #$(pwd)
OLDIFS=$IFS
IFS=:
for file in "$(direc)/*"
do
mv "$file" "%%1"
done
IFS=$OLDIFS

27.指定目录下搜索文件
#!/bin/sh
find -name "%%1"

28.打开文件对话框
#!/bin/sh
%%1="$(Xdialog --fselect '~/' 0 0 2>&1)"

29.文件分割
#!/bin/sh
split -b 2k "%%1"

while read f1 f2 f3
do
    echo $f1 >> f1
    echo $f2 >> f2
    echo $f3 >> f3
done


#!/bin/bash
  linenum=`wc   -l   httperr8007.log|   awk   '{print   $1}'`  
  n1=1  
  file=1  
  while   [   $n1   -lt   $linenum   ]  
  do  
                  n2=`expr   $n1   +   999`  
                  sed   -n   "${n1},   ${n2}p"   httperr8007.log >   file_$file.log    
                  n1=`expr   $n2   +   1`  
                  file=`expr   $file   +   1`  
  done  




其中httperr8007.log为你想分割的大文件,file_$file.log  为分割后的文件,最后为file_1.log,file_2.log,file_3.log……,分割完后的每个文件只有1000行(参数可以自己设置)

split 参数:
-b  :后面可接欲分割成的档案大小,可加单位,例如 b, k, m 等;
-l  :以行数来进行分割;



#按每个文件1000行来分割除

split -l 1000 httperr8007.log httperr

httpaa,httpab,httpac ........

#按照每个文件100K来分割

split -b 100k httperr8007.log http

httpaa,httpab,httpac ........

#!/bin/bash
if [ $# -ne 2 ]; then
echo 'Usage: split file size(in bytes)'
exit
fi

file=$1
size=$2

if [ ! -f $file ]; then
echo "$file doesn't exist"
exit
fi

#TODO: test if $size is a valid integer

filesize=`/bin/ls -l $file | awk '{print $5}'`
echo filesize: $filesize

let pieces=$filesize/$size
let remain=$filesize-$pieces*$size
if [ $remain -gt 0 ]; then
let pieces=$pieces+1
fi
echo pieces: $pieces

i=0
while [ $i -lt $pieces ];
do
echo split: $file.$i:
dd if=$file of=$file.$i bs=$size count=1 skip=$i
let i=$i+1
done

echo "#!/bin/bash" > merge

echo "i=0" >> merge
echo "while [ $i -lt $pieces ];" >> merge
echo "do" >> merge
echo " echo merge: $file.$i" >> merge
echo " if [ ! -f $file.$i ]; then" >> merge
echo " echo merge: $file.$i missed" >> merge
echo " rm -f $file.merged" >> merge
echo " exit" >> merge
echo " fi" >> merge
echo " dd if=$file.$i of=$file.merged bs=$size count=1 seek=$i" >> merge
echo " let i=$i+1" >> merge
echo "done" >> merge
chmod u+x merge'

30.文件合并
#!/bin/sh
cp "%%1"+"%%2" "%%3"

exec 3> join.txt
done

#!/bin/bash
if [ $# -ne 2 ]; then
echo 'Usage: split file size(in bytes)'
exit
fi

file=$1
size=$2

if [ ! -f $file ]; then
echo "$file doesn't exist"
exit
fi

#TODO: test if $size is a valid integer

filesize=`/bin/ls -l $file | awk '{print $5}'`
echo filesize: $filesize

let pieces=$filesize/$size
let remain=$filesize-$pieces*$size
if [ $remain -gt 0 ]; then
let pieces=$pieces+1
fi
echo pieces: $pieces

i=0
while [ $i -lt $pieces ];
do
echo split: $file.$i:
dd if=$file of=$file.$i bs=$size count=1 skip=$i
let i=$i+1
done

echo "#!/bin/bash" > merge

echo "i=0" >> merge
echo "while [ $i -lt $pieces ];" >> merge
echo "do" >> merge
echo " echo merge: $file.$i" >> merge
echo " if [ ! -f $file.$i ]; then" >> merge
echo " echo merge: $file.$i missed" >> merge
echo " rm -f $file.merged" >> merge
echo " exit" >> merge
echo " fi" >> merge
echo " dd if=$file.$i of=$file.merged bs=$size count=1 seek=$i" >> merge
echo " let i=$i+1" >> merge
echo "done" >> merge
chmod u+x merge'

31.文件简单加密
#!/bin/bash
#make test && make strings && sudo make install
shc -r -f %%1.sh
#%%1.x
#%%1.x.c

32.文件简单解密
#!/bin/bash
#make test && make strings && sudo make install
shc -r -f %%1.sh
#%%1.x
#%%1.x.c

33.读取ini文件属性
#!/bin/bash
if [ "$%%3" = "" ];then
   sed -n "/\[$%%2\]/,/\[.*\]/{
   /^\[.*\]/d
   /^[ ]*$/d
   s/;.*$//
   p
   }" $1
elif [ "$%%4" = "" ];then
   sed -n "/\[$%%2\]/,/\[.*\]/{
   /^\[.*\]/d
   /^[ ]*$/d
   s/;.*$//
   s/^[ |        ]*$%%3[ | ]*=[ |   ]*\(.*\)[ |     ]*/\1/p
   }" $1
else
       if [ "$%%4" = "#" ];then
            sed "/\[$%%2\]/,/\[.*\]/{
            s/^[ |        ]*$%%3[ |    ]*=.*/ /
            }p" $1 > /tmp/sed$$
            mv /tmp/sed$$ $1
       else
            sed "/\[$2\]/,/\[.*\]/{
            s/^[ |        ]*$%%3[ |    ]*=.*/$%%3=$%%4/
            }p" $1 > /tmp/sed$$
            mv /tmp/sed$$ $%%1
       fi
fi

34.合并一个文件下所有的文件
#!/bin/sh
cat $(ls |grep -E '%%1\.') > %%1

#!/bin/bash
OLDIFS=$IFS
IFS=:
for path in $( find %%1 -type d -printf "%p$IFS")
do
for file in $path/*.c $path/*.cpp
do
if [[ ! "$file" =~ \*.[A-Za-z]+ ]]; then
#"$(path)/$(file)"
fi
done
done
IFS=$OLDIFS

#!/bin/bash
cat <<'EOF'> combine.c
#include
int main()
{
FILE *f1,*f2,*f3;
f1=fopen("a1.txt","r");
f2=fopen("a2.txt","r");
f3=fopen("a3.txt","w");
int a,b;
a=getw(f1);   /*从a1.txt和a2.txt中分别取最小的数a和b*/
b=getw(f2);
while(!feof(f1)&&!feof(f2))  /*两个文件都没结束时,执行循环、比较*/
{
if(a<=b)
{
putw(a,f3);
a=getw(f1);
}
else
{putw(b,f3);
b=getw(f2);
}
   }
if(feof(f1))  /*文件a1.txt结束时,把a2.txt中的数全部输入a3.txt*/
{putw(b,f3);
while((b=getw(f2))!=EOF)
putw(b,f3);
}
if(feof(f2))   /*同上*/
{
putw(a,f3);
while((a=getw(f1))!=EOF)
putw(a,f3);
}
fclose(f1);
fclose(f2);
fclose(f3);
printf("已完成!");
return 0;
}
EOF
gcc -o combine combine.c
if [ $? -eq 0 ]; then
./combine
else
echo 'Compile ERROR'
fi

35.写入ini文件属性
#!/bin/bash
if [ "$%%3" = "" ];then
   sed -n "/\[$%%2\]/,/\[.*\]/{
   /^\[.*\]/d
   /^[ ]*$/d
   s/;.*$//
   p
   }" $1
elif [ "$%%4" = "" ];then
   sed -n "/\[$%%2\]/,/\[.*\]/{
   /^\[.*\]/d
   /^[ ]*$/d
   s/;.*$//
   s/^[ |        ]*$%%3[ | ]*=[ |   ]*\(.*\)[ |     ]*/\1/p
   }" $1
else
       if [ "$%%4" = "#" ];then
            sed "/\[$%%2\]/,/\[.*\]/{
            s/^[ |        ]*$%%3[ |    ]*=.*/ /
            }p" $1 > /tmp/sed$$
            mv /tmp/sed$$ $%%1
       else
            sed "/\[$%%2\]/,/\[.*\]/{
            s/^[ |        ]*$%%3[ |    ]*=.*/$%%3=$%%4/
            }p" $1 > /tmp/sed$$
            mv /tmp/sed$$ $%%1
       fi
fi

36.获得当前路径
#!/bin/sh
%%1=$(pwd)

37.读取XML数据库

如何通过shell命令行读取xml文件中某个属性所对应的值?
例如:
BuildVersion 5
我希望能够通过Unix shell命令对属性键的名称BuildVersion进行查询,返回的结果是5,如何实现呀?
#!/bin/bash
grep BuildVersion|sed 's/.*<.*>\([^<].*\)<.*>.*/\1/'

结果返回的是“BuildVersion”,而不是“5”,如果要查询BuildVersion自动返回数值5应当如何写?

应该没错的。试一下: echo "BuildVersion 5"|grep BuildVersion|sed 's/.*<.*>\([^<].*\)<.*>.*/\1/'我在SL的终端里试,返回值是5

目前需要从xml文件提取数据,想做一个xmlparser.sh
xml 类似这样

   



希望输入 xmlparser.sh a.xml hostip可以返回192.168.0.1


#!/bin/sh

if [ $# -ne 2 ];then
   echo "Usage: $0  "
   exit 0
fi

grep $2 $1|awk '{print $2}'|grep -o "[0-9.]*"


把
grep $2 $1|awk '{print $2}'|grep -o "[0-9.]*"
改成
grep $2 $1|awk '{print $2}'|grep -Eo "[0-9.]+"
楼上这个有问题,如果我要得到的是

   

中的sharename,那么,呵呵,就错了

我觉得应该先定位到第二个参数“$2”的位置,然后再提取“=”后面的内容

这里有个完整的实现:
Parse Simple XML Files using Bash – Extract Name Value Pairs and Attributes
http://www.humbug.in/2010/parse-simple-xml-files-using-bash-extract-name-value-pairs-and-attributes/


不过需要安装xmllint.

设计到对多个xml文件进行element的读取和列表。有人做过么?
举个例子,
多个xml文件里面都有
xxx</titlel> </article> 通过shell读取,然后合并到一起,再生成一个新的xml,但是其他元素不变。 <article> <title>aaa</titlel> </article> <article> <title>bbb</titlel> </article> 如果格式异常简单,没有特例,那么可以用shell实现 如果有可能格式复杂,因为shell的命令所使用的正则表达式都不支持跨行匹配,所以用shell来解决这个问题就绕圈子了。 用perl来作这个工作最直接、简单。perl的XML:DOM模块是专门处理XML文件的。 偶倒是觉得,用PHP写Scripts也很方便,功能强大,而且,跨平台, #!/bin/sh sed -n '/<article>/{ N; /\n[[:space:]]*<title>/{ N; /<article>.*<\/article>/p } D; n }' 这小段代码能把一个xml文件中,你要的东西拿出来. 你可以用for file in $*把这些信息都>>tmpfile中. 然后用sed 在指定文件的指定位置用r命令把tmpfile粘贴进来~~~~ 大思路如此^_^ 我想有这个东西(只要能正确的跑出结果)后面就不难了吧... Name xmllint — command line XML tool Synopsis xmllint [[--version] | [--debug] | [--shell] | [--debugent] | [--copy] | [--recover] | [--noent] | [--noout] | [--nonet] | [--htmlout] | [--nowrap] | [--valid] | [--postvalid] | [--dtdvalid URL] | [--dtdvalidfpi FPI] | [--timing] | [--output file] | [--repeat] | [--insert] | [--compress] | [--html] | [--xmlout] | [--push] | [--memory] | [--maxmem nbbytes] | [--nowarning] | [--noblanks] | [--nocdata] | [--format] | [--encode encoding] | [--dropdtd] | [--nsclean] | [--testIO] | [--catalogs] | [--nocatalogs] | [--auto] | [--xinclude] | [--noxincludenode] | [--loaddtd] | [--dtdattr] | [--stream] | [--walker] | [--pattern patternvalue] | [--chkregister] | [--relaxng] | [--schema] | [--c14n]] [xmlfile] Introduction The xmllint program parses one or more XML files, specified on the command line as xmlfile. It prints various types of output, depending upon the options selected. It is useful for detecting errors both in XML code and in the XML parser itself. It is included in libxml2. Options --version Display the version of libxml2 used. --debug Parse a file and output an annotated tree of the in-memory version of the document. --shell Run a navigating shell. Details on available commands in shell mode are below. --debugent Debug the entities defined in the document. --copy Test the internal copy implementation. --recover Output any parsable portions of an invalid document. --noent Substitute entity values for entity references. By default, xmllint leaves entity references in place. --nocdata Substitute CDATA section by equivalent text nodes. --nsclean Remove redundant namespace declarations. --noout Suppress output. By default, xmllint outputs the result tree. --htmlout Output results as an HTML file. This causes xmllint to output the necessary HTML tags surrounding the result tree output so the results can be displayed in a browser. --nowrap Do not output HTML doc wrapper. --valid Determine if the document is a valid instance of the included Document Type Definition (DTD). A DTD to be validated against also can be specified at the command line using the --dtdvalid option. By default, xmllint also checks to determine if the document is well-formed. --postvalid Validate after parsing is completed. --dtdvalid URL Use the DTD specified by URL for validation. --dtdvalidfpi FPI Use the DTD specified by the Public Identifier FPI for validation, note that this will require a Catalog exporting that Public Identifier to work. --timing Output information about the time it takes xmllint to perform the various steps. --output file Define a file path where xmllint will save the result of parsing. Usually the programs build a tree and save it on stdout, with this option the result XML instance will be saved onto a file. --repeat Repeat 100 times, for timing or profiling. --insert Test for valid insertions. --compress Turn on gzip compression of output. --html Use the HTML parser. --xmlout Used in conjunction with --html. Usually when HTML is parsed the document is saved with the HTML serializer, but with this option the resulting document is saved with the XML serializer. This is primarily used to generate XHTML from HTML input. --push Use the push mode of the parser. --memory Parse from memory. --maxmem nnbytes Test the parser memory support. nnbytes is the maximum number of bytes the library is allowed to allocate. This can also be used to make sure batch processing of XML files will not exhaust the virtual memory of the server running them. --nowarning Do not emit warnings from the parser and/or validator. --noblanks Drop ignorable blank spaces. --format Reformat and reindent the output. The $XMLLINT_INDENT environment variable controls the indentation (default value is two spaces " "). --testIO Test user input/output support. --encode encoding Output in the given encoding. --catalogs Use the catalogs from $SGML_CATALOG_FILES. Otherwise /etc/xml/catalog is used by default. --nocatalogs Do not use any catalogs. --auto Generate a small document for testing purposes. --xinclude Do XInclude processing. --noxincludenode Do XInclude processing but do not generate XInclude start and end nodes. --loaddtd Fetch external DTD. --dtdattr Fetch external DTD and populate the tree with inherited attributes. --dropdtd Remove DTD from output. --stream Use streaming API - useful when used in combination with --relaxng or --valid options for validation of files that are too large to be held in memory. --walker Test the walker module, which is a reader interface but for a document tree, instead of using the reader API on an unparsed document it works on a existing in-memory tree. Used in debugging. --chkregister Turn on node registration. Useful for developers testing libxml2 node tracking code. --pattern patternvalue Used to exercise the pattern recognition engine, which can be used with the reader interface to the parser. It allows to select some nodes in the document based on an XPath (subset) expression. Used for debugging. --relaxng schema Use RelaxNG file named schema for validation. --schema schema Use a W3C XML Schema file named schema for validation. --c14n Use the W3C XML Canonicalisation (C14N) to serialize the result of parsing to stdout. It keeps comments in the result. Shell xmllint offers an interactive shell mode invoked with the --shell command. Available commands in shell mode include: base display XML base of the node bye leave shell cat node Display node if given or current node. cd path Change the current node to path (if given and unique) or root if no argument given. dir path Dumps information about the node (namespace, attributes, content). du path Show the structure of the subtree under path or the current node. exit Leave the shell. help Show this help. free Display memory usage. load name Load a new document with the given name. ls path List contents of path (if given) or the current directory. pwd Display the path to the current node. quit Leave the shell. save name Saves the current document to name if given or to the original name. validate Check the document for error. write name Write the current node to the given filename. Catalogs Catalog behavior can be changed by redirecting queries to the user's own set of catalogs. This can be done by setting the XML_CATALOG_FILES environment variable to a list of catalogs. An empty one should deactivate loading the default /etc/xml/catalog default catalog. Debugging Catalogs Setting the environment variable XML_DEBUG_CATALOG using the command "export XML_DEBUG_CATALOG=" outputs debugging information related to catalog operations. Error Return Codes On the completion of execution, Xmllint returns the following error codes: 0 No error 1 Unclassified 2 Error in DTD 3 Validation error 4 Validation error 5 Error in schema compilation 6 Error writing output 7 Error in pattern (generated when [--pattern] option is used) 8 Error in Reader registration (generated when [--chkregister] option is used) 9 Out of memory error Parse Simple XML Files using Bash – Extract Name Value Pairs and Attributes 2 Comments 1 Tweet Pratik Sinha | July 31, 2010 I have written up a simple routine par***ML to parse simple XML files to extract unique name values pairs and their attributes. The script extracts all xml tags of the format <abc arg1="hello">xyz</abc> and dynamically creates bash variables which hold values of the attributes as well as the elements. This is a good solution, if you don’t wish to use xpath for some simple xml files. However you will need xmllint installed on your system to use the script. Here’s a sample script which uses the par***ML function #!/bin/bash xmlFile=$1 function par***ML() { elemList=( $(cat $xmlFile | tr '\n' ' ' | XMLLINT_INDENT="" xmllint --format - | /bin/grep -e "</.*>$" | while read line; do \ echo $line | sed -e 's/^.*<\///' | cut -d '>' -f 1; \ done) ) totalNoOfTags=${#elemList[@]}; ((totalNoOfTags--)) suffix=$(echo ${elemList[$totalNoOfTags]} | tr -d '</>') suffix="${suffix}_" for (( i = 0 ; i < ${#elemList[@]} ; i++ )); do elem=${elemList[$i]} elemLine=$(cat $xmlFile | tr '\n' ' ' | XMLLINT_INDENT="" xmllint --format - | /bin/grep "</$elem>") echo $elemLine | grep -e "^</[^ ]*>$" 1>/dev/null 2>&1 if [ "0" = "$?" ]; then continue fi elemVal=$(echo $elemLine | tr '\011' '\040'| sed -e 's/^[ ]*//' -e 's/^<.*>\([^<].*\)<.*>$/\1/' | sed -e 's/^[ ]*//' | sed -e 's/[ ]*$//') xmlElem="${suffix}$(echo $elem | sed 's/-/_/g')" eval ${xmlElem}=`echo -ne \""${elemVal}"\"` attrList=($(cat $xmlFile | tr '\n' ' ' | XMLLINT_INDENT="" xmllint --format - | /bin/grep "</$elem>" | tr '\011' '\040' | sed -e 's/^[ ]*//' | cut -d '>' -f 1 | sed -e 's/^<[^ ]*//' | tr "'" '"' | tr '"' '\n' | tr '=' '\n' | sed -e 's/^[ ]*//' | sed '/^$/d' | tr '\011' '\040' | tr ' ' '>')) for (( j = 0 ; j < ${#attrList[@]} ; j++ )); do attr=${attrList[$j]} ((j++)) attrVal=$(echo ${attrList[$j]} | tr '>' ' ') attrName=`echo -ne ${xmlElem}_${attr}` eval ${attrName}=`echo -ne \""${attrVal}"\"` done done } par***ML echo "$status_xyz | $status_abc | $status_pqr" #Variables for each XML ELement echo "$status_xyz_arg1 | $status_abc_arg2 | $status_pqr_arg3 | $status_pqr_arg4" #Variables for each XML Attribute echo "" #All the variables that were produced by the par***ML function set | /bin/grep -e "^$suffix" The XML File used for the above script example is: <?xml version="1.0"?> <status> <xyz arg1="1"> a </xyz> <abc arg2="2"> p </abc> <pqr arg3="3" arg4="a phrase"> x </pqr> </status> The root tag, which in this case is “status”, is used as a suffix for all variables. Once the XML file is passed to the function, it dynamically creates the variables $status_xyz, $status_abc, $status_pqr, $status_xyz_arg1, $status_abc_arg2, $status_pqr_arg3 and $status_pqr_arg4. The output when the script is ran with the xml file as an argument is @$ bash par***ML.sh test.xml a | p | x 1 | 2 | 3 | a phrase status_abc=p status_abc_arg2=2 status_pqr=x status_pqr_arg3=3 status_pqr_arg4='a phrase' status_xyz=a status_xyz_arg1=1 This script won’t work for XML files like the one below with duplicate element names. <?xml version="1.0"?> <status> <test arg1="1"> a </test> <test arg2="2"> p </test> <test arg3="3" arg4="a phrase"> x </test> </status> This script also won’t be able to extract attributes of elements without any CDATA. For eg, the script won’t be able to create variables corresponding to <test arg1="1">. It will only create the variables corresponding to <test1 arg2="2">abc</test1>. <?xml version="1.0"?> <status> <test arg1="1"> <test1 arg2="2">abc</test1> </test> </status> 38.写入XML数据库 #!/bin/bash 39.ZIP压缩文件 #!/bin/sh zip -r "/%%1" "%%2" 40.ZIP解压缩 #!/bin/sh unzip -x "/%%1" "%%2" 41.获得应用程序完整路径 #!/bin/bash 42.ZIP压缩文件夹 #!/bin/bash 43.递归删除目录下的文件 #!/bin/bash rm -if "%%1/*" OLDIFS=$IFS IFS=: for path in $( find %%1 -type d -printf "%p$IFS") do for file in $path/*.c $path/*.cpp do if [[ ! "$file" =~ \*.[A-Za-z]+ ]]; then #"$(path)/$(file)" fi done done IFS=$OLDIFS 44.IDEA加密算法 #!/bin/bash 45.RC6算法 #!/bin/bash cat <<'EOF'> rc6.c #include<stdio.h> /* Timing data for RC6 (rc6.c) 128 bit key: Key Setup: 1632 cycles Encrypt: 270 cycles = 94.8 mbits/sec Decrypt: 226 cycles = 113.3 mbits/sec Mean: 248 cycles = 103.2 mbits/sec 192 bit key: Key Setup: 1885 cycles Encrypt: 267 cycles = 95.9 mbits/sec Decrypt: 235 cycles = 108.9 mbits/sec Mean: 251 cycles = 102.0 mbits/sec 256 bit key: Key Setup: 1877 cycles Encrypt: 270 cycles = 94.8 mbits/sec Decrypt: 227 cycles = 112.8 mbits/sec Mean: 249 cycles = 103.0 mbits/sec */ #include "../std_defs.h" static char *alg_name[] = { "rc6", "rc6.c", "rc6" }; char **cipher_name() { return alg_name; } #define f_rnd(i,a,b,c,d) \ u = rotl(d * (d + d + 1), 5); \ t = rotl(b * (b + b + 1), 5); \ a = rotl(a ^ t, u) + l_key; \ c = rotl(c ^ u, t) + l_key[i + 1] #define i_rnd(i,a,b,c,d) \ u = rotl(d * (d + d + 1), 5); \ t = rotl(b * (b + b + 1), 5); \ c = rotr(c - l_key[i + 1], t) ^ u; \ a = rotr(a - l_key, u) ^ t u4byte l_key[44]; /* storage for the key schedule */ /* initialise the key schedule from the user supplied key */ u4byte *set_key(const u4byte in_key[], const u4byte key_len) { u4byte i, j, k, a, b, l[8], t; l_key[0] = 0xb7e15163; for(k = 1; k < 44; ++k) l_key[k] = l_key[k - 1] + 0x9e3779b9; for(k = 0; k < key_len / 32; ++k) l[k] = in_key[k]; t = (key_len / 32) - 1; // t = (key_len / 32); a = b = i = j = 0; for(k = 0; k < 132; ++k) { a = rotl(l_key + a + b, 3); b += a; b = rotl(l[j] + b, b); l_key = a; l[j] = b; i = (i == 43 ? 0 : i + 1); // i = (i + 1) % 44; j = (j == t ? 0 : j + 1); // j = (j + 1) % t; } return l_key; }; /* encrypt a block of text */ void encrypt(const u4byte in_blk[4], u4byte out_blk[4]) { u4byte a,b,c,d,t,u; a = in_blk[0]; b = in_blk[1] + l_key[0]; c = in_blk[2]; d = in_blk[3] + l_key[1]; f_rnd( 2,a,b,c,d); f_rnd( 4,b,c,d,a); f_rnd( 6,c,d,a,b); f_rnd( 8,d,a,b,c); f_rnd(10,a,b,c,d); f_rnd(12,b,c,d,a); f_rnd(14,c,d,a,b); f_rnd(16,d,a,b,c); f_rnd(18,a,b,c,d); f_rnd(20,b,c,d,a); f_rnd(22,c,d,a,b); f_rnd(24,d,a,b,c); f_rnd(26,a,b,c,d); f_rnd(28,b,c,d,a); f_rnd(30,c,d,a,b); f_rnd(32,d,a,b,c); f_rnd(34,a,b,c,d); f_rnd(36,b,c,d,a); f_rnd(38,c,d,a,b); f_rnd(40,d,a,b,c); out_blk[0] = a + l_key[42]; out_blk[1] = b; out_blk[2] = c + l_key[43]; out_blk[3] = d; }; /* decrypt a block of text */ void decrypt(const u4byte in_blk[4], u4byte out_blk[4]) { u4byte a,b,c,d,t,u; d = in_blk[3]; c = in_blk[2] - l_key[43]; b = in_blk[1]; a = in_blk[0] - l_key[42]; i_rnd(40,d,a,b,c); i_rnd(38,c,d,a,b); i_rnd(36,b,c,d,a); i_rnd(34,a,b,c,d); i_rnd(32,d,a,b,c); i_rnd(30,c,d,a,b); i_rnd(28,b,c,d,a); i_rnd(26,a,b,c,d); i_rnd(24,d,a,b,c); i_rnd(22,c,d,a,b); i_rnd(20,b,c,d,a); i_rnd(18,a,b,c,d); i_rnd(16,d,a,b,c); i_rnd(14,c,d,a,b); i_rnd(12,b,c,d,a); i_rnd(10,a,b,c,d); i_rnd( 8,d,a,b,c); i_rnd( 6,c,d,a,b); i_rnd( 4,b,c,d,a); i_rnd( 2,a,b,c,d); out_blk[3] = d - l_key[1]; out_blk[2] = c; out_blk[1] = b - l_key[0]; out_blk[0] = a; }; int main() { return 0; } EOF gcc -o rc6 rc6.c if [ $? -eq 0 ]; then ./combine else echo 'Compile ERROR' fi 46.Grep #!/bin/bash grep -qE %%1 %%2 47.直接创建多级目录 #!/bin/bash mkdir -p %%1 48.批量重命名 #!/bin/bash find $PWD -type f -name '*\.cpp' |sed s/'\.cpp'//g|awk '{MV = "mv"};{C = "\.c"};{ CPP="\.cpp"}; {print MV, $1 CPP , $1 C}'|sh ls | awk -F '-' '{print "mv "$0" "$2}' #去掉带'-'的前缀 49.文本查找替换 #!/bin/bash sed -e 's:%%2:%%3:g' %%1 #sed -e 's/%%2/%%3/g' %%1 50.文件关联 #!/bin/bash 51.批量转换编码从GB2312到Unicode #!/bin/bash scode="gbk" dcode="ucs2" for FILE in $(find $(pwd) -type f) do TMP_file=$(mktemp -p $(pwd)) if [ -f $FILE ]; then Fright=$(stat -c %a $FILE) Fuser=$(stat -c %U $FILE) Fgrp=$(stat -c %G $FILE) iconv -f $scode -t $dcode $FILE -o $TMP_file mv $TMP_file $FILE chmod $Fright $FILE chown $Fuser.$Fgrp $FILE fi done 52.设置JDK环境变量 #!/bin/bash find "$PWD" -type f \( -iname '*.bin' \) -print0 | xargs -0 chmod +x find -type f \( -iname '*.bin' \) -print | while read filename do case "$filename" in *.bin) xterm -e "$filename" && rm -if "$filename" ;; esac done OLDIFS=$IFS IFS=$'\n' for line in `cat ~/.bashrc` do if [[ "$line" =~ .*export.* ]]; then if [[ "$line" =~ .*JAVA_HOME=.* ]]; then if [[ "$line" =~ =(\/([0-9a-zA-Z._]+))+ ]]; then javahome=$line fi fi fi if [[ "$line" =~ export\ PATH=\$PATH:\$JAVA_HOME/bin:\$JAVA_HOME/jre/bin$ ]];then javapath=$line fi if [[ "$line" =~ export\ CLASSPATH=.:\$JAVA_HOME/lib:\$JAVA_HOME/jre/lib$ ]];then classpath=$line fi done if [ ! -n "$javahome" ]; then sed -i '$a export JAVA_HOME='$(pwd)'/jdk1.6.0_25' ~/.bashrc else sed -i 's:'${javahome//\\/\\\\}':export JAVA_HOME='$(pwd)'/jdk1.6.0_32:g' ~/.bashrc fi if [ ! -n "$javapath" ]; then sed -i '$a export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin' ~/.bashrc fi if [ ! -n "$classpath" ]; then sed -i '$a export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib' ~/.bashrc fi IFS=$OLDIFS #!/bin/bash shift OLDIFS=$IFS IFS=$'\n' for line in `cat ~/TestBash.txt` #~/.bashrc do if [[ "$line" =~ .*export.* ]]; then if [[ "$line" =~ export\ CLASSPATH=.:\$JAVA_HOME/lib:\$JAVA_HOME/jre/lib$ ]]; then classpath=$line elif [[ "$line" =~ export\ PATH=\$PATH:\$CATALINA_HOME/bin$ ]]; then jbosspath=$line fi if [[ "$line" =~ .*JAVA_HOME=.* ]]; then if [[ "$line" =~ =(\/([0-9a-zA-Z._]+))+ ]];then javahome=$line fi elif [[ "$line" =~ .*CATALINA_HOME=.* ]];then if [[ "$line" =~ =(\/([0-9a-zA-Z._]+))+ ]];then catalinahome=$line fi elif [[ "$line" =~ .*TOMCAT_HOME=.* ]];then if [[ "$line" =~ =(\/([0-9a-zA-Z._]+))+ ]];then tomcathome=$line fi elif [[ "$line" =~ .*CATALINA_BASE=.* ]];then if [[ "$line" =~ =(\/([0-9a-zA-Z._]+))+ ]];then catalinabase=$line fi elif [[ "$line" =~ .*JBOSS_HOME=.* ]];then if [[ "$line" =~ =(\/([0-9a-zA-Z._]+))+ ]];then jbosshome=$line fi fi elif [[ "$line" =~ ^PATH=\$PATH:\$JAVA_HOME/bin:\$JAVA_HOME/jre/bin$ ]];then javapath=$line fi if [[ "$line" =~ export\ CLASSPATH=.:\$JAVA_HOME/lib:\$JAVA_HOME/jre/lib$ ]];then classpath=$line fi if [[ "$line" =~ export\ PATH=\$PATH:\$JBOSS_HOME/bin$ ]];then jbosspath=$line fi done if [ ! -n "$javahome" ]; then sed -i '$a export JAVA_HOME='$(pwd)'/jdk1.6.0_24' ~/TestBash.txt #~/.bashrc else sed -i 's:'${javahome//\\/\\\\}':export JAVA_HOME='$(pwd)'/jdk1.6.0_24:g' ~/TestBash.txt fi if [ ! -n "$javapath" ]; then sed -i '$a PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin' ~/TestBash.txt #~/.bashrc fi if [ ! -n "$classpath" ]; then sed -i '$a export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib' ~/TestBash.txt #~/.bashrc fi if [ ! -n "$catalinahome" ]; then sed -i '$a export CATALINA_HOME='$(pwd) ~/TestBash.txt #~/.bashrc else sed -i 's:'${catalinahome//\\/\\\\}':export CATALINA_HOME='$(pwd)':g' ~/TestBash.txt fi if [ ! -n "$tomcathome" ]; then sed -i '$a export TOMCAT_HOME='$(pwd) ~/TestBash.txt #~/.bashrc else sed -i 's:'${tomcathome//\\/\\\\}':export TOMCAT_HOME='$(pwd)':g' ~/TestBash.txt fi if [ ! -n "$catalinabase" ]; then sed -i '$a export CATALINA_BASE='$(pwd) ~/TestBash.txt #~/.bashrc else sed -i 's:'${catalinabase//\\/\\\\}':export CATALINA_BASE='$(pwd)':g' ~/TestBash.txt fi if [ ! -n "$jbosshome" ]; then sed -i '$a export JBOSS_HOME='$(pwd) ~/TestBash.txt #~/.bashrc else sed -i 's:'${jbosshome//\\/\\\\}':export JBOSS_HOME='$(pwd)':g' ~/TestBash.txt fi if [ ! -n "$jbosspath" ]; then sed -i '$a export PATH=$PATH:$CATALINA_HOME/bin' ~/TestBash.txt #~/.bashrc fi IFS=$OLDIFS 53.批量转换编码从Unicode到GB2312 #!/bin/bash scode="ucs2" dcode="gbk" for FILE in $(find $(pwd) -type f) do TMP_file=$(mktemp -p $(pwd)) if [ -f $FILE ]; then Fright=$(stat -c %a $FILE) Fuser=$(stat -c %U $FILE) Fgrp=$(stat -c %G $FILE) iconv -f $scode -t $dcode $FILE -o $TMP_file mv $TMP_file $FILE chmod $Fright $FILE chown $Fuser.$Fgrp $FILE fi done 54.删除空文件夹 #!/bin/bash rmdir -p %%1 55.GB2312文件转UTF-8格式 #!/bin/bash iconv -f gbk -t utf8 %%1 -o %%2 56.UTF-8文件转GB2312格式 #!/bin/bash iconv -f utf8 -t gbk %%1 -o %%2 57.获取文件路径的父路径 #!/bin/bash %%1=basename $PWD 58.Unicode文件转UTF-8格式 #!/bin/bash iconv -f ucs2 -t utf-8 %%1 -o %%2 59.CRC循环冗余校验 #!/bin/bash cat <<'EOF'> crc.c #include<stdio.h> unsigned long int crc32_table[256]; unsigned long int ulPolynomial = 0x04c11db7; unsigned long int Reflect(unsigned long int ref, char ch) { unsigned long int value(0); // 交换bit0和bit7,bit1和bit6,类推 for(int i = 1; i < (ch + 1); i++) { if(ref & 1) value |= 1 << (ch - i); ref >>= 1; } return value; } init_crc32_table() { unsigned long int crc,temp; // 256个值 for(int i = 0; i <= 0xFF; i++) { temp=Reflect(i, 8); crc32_table[i]= temp<< 24; for (int j = 0; j < 8; j++){ unsigned long int t1,t2; unsigned long int flag=crc32_table[i]&0x80000000; t1=(crc32_table[i] << 1); if(flag==0) t2=0; else t2=ulPolynomial; crc32_table[i] =t1^t2 ; } crc=crc32_table[i]; crc32_table[i] = Reflect(crc32_table[i], 32); } } unsigned long GenerateCRC32(char xdata * DataBuf,unsigned long len) { unsigned long oldcrc32; unsigned long crc32; unsigned long oldcrc; unsigned int charcnt; char c,t; oldcrc32 = 0x00000000; //初值为0 charcnt=0; while (len--) { t= (oldcrc32 >> 24) & 0xFF; //要移出的字节的值 oldcrc=crc_32_tab[t]; //根据移出的字节的值查表 c=DataBuf[charcnt]; //新移进来的字节值 oldcrc32= (oldcrc32 << 8) | c; //将新移进来的字节值添在寄存器末字节中 oldcrc32=oldcrc32^oldcrc; //将寄存器与查出的值进行xor运算 charcnt++; } crc32=oldcrc32; return crc32; } 参数表可以先在PC机上算出来,也可在程序初始化时完成。下面是用于计算参数表的c语言子程序,在Visual C++ 6.0下编译通过。 #include <stdio.h> unsigned long int crc32_table[256]; unsigned long int ulPolynomial = 0x04c11db7; unsigned long int Reflect(unsigned long int ref, char ch) { unsigned long int value(0); // 交换bit0和bit7,bit1和bit6,类推 for(int i = 1; i < (ch + 1); i++) { if(ref & 1) value |= 1 << (ch - i); ref >>= 1; } return value; } int main() { unsigned long int crc,temp; // 256个值 for(int i = 0; i <= 0xFF; i++) { temp=Reflect(i, 8); crc32_table[i]= temp<< 24; for (int j = 0; j < 8; j++){ unsigned long int t1,t2; unsigned long int flag=crc32_table[i]&0x80000000; t1=(crc32_table[i] << 1); if(flag==0) t2=0; else t2=ulPolynomial; crc32_table[i] =t1^t2 ; } crc=crc32_table[i]; crc32_table[i] = Reflect(crc32_table[i], 32); } return 0; } EOF gcc -o crc crc.c if [ $? -eq 0 ]; then ./combine else echo 'Compile ERROR' fi 60.判断是否为空文件 #!/bin/bash 61.终止程序 #!/bin/sh kill -KILL pidof %%1 -s #killall %%1 62.定时关机 #!/bin/sh shutdown -h %%1 & #23:00 #shutdown -h now #halt #/sbin/poweroff #init 0 63.显示进程列表 #!/bin/sh ps aux #fuser -l 64.遍历文件夹列出文件大小 #!/bin/sh du -sH "%%1/*" 65.GOST算法 #!/bin/bash 66.对目标压缩文件解压缩到指定文件夹 #!/bin/bash 67.保存文件时重名自动生成新文件 #!/bin/bash 68.打开网页 #!/bin/sh lynx %%1 69.删除空文件夹整合操作 #!/bin/bash 70.获取磁盘所有分区 #!/bin/sh df -k 71.激活一个程序或程序关联的文件 #!/bin/bash 72.MP3播放 #!/bin/sh amp "%%1" 73.WAV播放 #!/bin/sh amp "%%1" 74.写图像到剪切板 #!/bin/bash 75.从剪贴板复制图像到窗体 #!/bin/bash 76.删除文件夹下的所有文件且不删除文件夹下的文件夹 #!/bin/sh rm -if "%%1/*" 77.XML遍历结点属性值 #!/bin/bash 78.Unicode文件转GB2312格式 #!/bin/sh iconv -f ucs2 -t gbk %%1 -o %%2 79.开源程序库Xercesc-C++代码工程中内联80.提取包含头文件列表 #!/bin/bash 81.GB2312文件转Unicode格式 #!/bin/sh iconv -f gbk -t ucs2 %%1 -o %%2 82.Java程序打包 #!/bin/bash 83.UTF-8文件转Unicode格式 #!/bin/bash iconv -f utf8 -t ucs2 %%1 -o %%2</pre> <p> </p> </div> </div> </div> </div> </div> <!--PC和WAP自适应版--> <div id="SOHUCS" sid="1177302394757771264"></div> <script type="text/javascript" src="/views/front/js/chanyan.js"></script> <!-- 文章页-底部 动态广告位 --> <div class="youdao-fixed-ad" id="detail_ad_bottom"></div> </div> <div class="col-md-3"> <div class="row" id="ad"> <!-- 文章页-右侧1 动态广告位 --> <div id="right-1" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_1"> </div> </div> <!-- 文章页-右侧2 动态广告位 --> <div id="right-2" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_2"></div> </div> <!-- 文章页-右侧3 动态广告位 --> <div id="right-3" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_3"></div> </div> </div> </div> </div> </div> </div> <div class="container"> <h4 class="pt20 mb15 mt0 border-top">你可能感兴趣的:(shell,文件操作,命令,linux)</h4> <div id="paradigm-article-related"> <div class="recommend-post mb30"> <ul class="widget-links"> <li><a href="/article/1829771366807728128.htm" title="安装tsc,command not found: tsc 找不到该命令" target="_blank">安装tsc,command not found: tsc 找不到该命令</a> <span class="text-muted">包淼淼</span> <a class="tag" taget="_blank" href="/search/webpack/1.htm">webpack</a> <div>一般出现这种情况是由于没有配置对tsc的环境变量导致的。配环境变量也有些麻烦,用npx就可以解决这个问题。因为npx会自动查找当前依赖包中的可执行文件,如果找不到,就会去PATH里找。如果依然找不到,就会帮你安装!npx和npm的区别npx侧重于执行命令的,执行某个模块命令。虽然会自动安装模块,但是重在执行某个命令。npm侧重于安装或者卸载某个模块的。重在安装,并不具备执行某个模块的功能。使用过程</div> </li> <li><a href="/article/1829771367290073088.htm" title="nvm常用命令" target="_blank">nvm常用命令</a> <span class="text-muted">包淼淼</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a> <div>nvmls:列出所有已安装的node版本nvmls-remote:列出所有远程服务器的版本(官方nodeversionlist)nvmlist:列出所有已安装的node版本nvmlistavailable:显示所有可下载的版本nvminstallstable:安装最新版nodenvminstall[node版本号]:安装指定版本nodenvmuninstall[node版本号]:删除已安装的指定版</div> </li> <li><a href="/article/1829770483223064576.htm" title="Redis源码剖析和注释(二十)--- 网络连接库剖析(client的创建/释放、命令接收/回复、Redis通信协议分析等)" target="_blank">Redis源码剖析和注释(二十)--- 网络连接库剖析(client的创建/释放、命令接收/回复、Redis通信协议分析等)</a> <span class="text-muted">men_wen</span> <a class="tag" taget="_blank" href="/search/Redis/1.htm">Redis</a><a class="tag" taget="_blank" href="/search/Redis/1.htm">Redis</a><a class="tag" taget="_blank" href="/search/3.2.8/1.htm">3.2.8</a><a class="tag" taget="_blank" href="/search/%E6%BA%90%E7%A0%81%E5%89%96%E6%9E%90%E6%B3%A8%E9%87%8A/1.htm">源码剖析注释</a><a class="tag" taget="_blank" href="/search/redis/1.htm">redis</a><a class="tag" taget="_blank" href="/search/%E7%BD%91%E7%BB%9C/1.htm">网络</a><a class="tag" taget="_blank" href="/search/%E6%BA%90%E7%A0%81/1.htm">源码</a><a class="tag" taget="_blank" href="/search/%E6%B3%A8%E9%87%8A/1.htm">注释</a><a class="tag" taget="_blank" href="/search/%E9%80%9A%E4%BF%A1/1.htm">通信</a> <div>Redis网络连接库剖析1.Redis网络连接库介绍Redis网络连接库对应的文件是networking.c。这个文件主要负责客户端的创建与释放命令接收与命令回复Redis通信协议分析CLIENT命令的实现我们接下来就这几块内容分别列出源码,进行剖析。2.客户端的创建与释放redis网络链接库的源码详细注释2.1客户端的创建Redis服务器是一个同时与多个客户端建立连接的程序。当客户端连接上服务器</div> </li> <li><a href="/article/1829769226274041856.htm" title="crtl + r search history" target="_blank">crtl + r search history</a> <span class="text-muted">charliecao</span> <div>Linux下的神器ctrl+r(reverse-i-search)的使用方法:(reverse-i-searchusage:)(pressctl+r)输入任意字符,例如:"mig"就会出现$rakedb:migrate(pressctrl+r,theninputthecontentyouwanttosearch)如果我想找另一个命令呢?输入完'mig'多按几次ctrl+r,就可以继续向前搜索“mi</div> </li> <li><a href="/article/1829767456118370304.htm" title="LuaJit分析(一)LuaJit交叉编译" target="_blank">LuaJit分析(一)LuaJit交叉编译</a> <span class="text-muted">CCTV果冻爽</span> <a class="tag" taget="_blank" href="/search/LuaJit%E5%88%86%E6%9E%90%E7%B3%BB%E5%88%97/1.htm">LuaJit分析系列</a><a class="tag" taget="_blank" href="/search/lua/1.htm">lua</a> <div>Android使用ndk版本r16b在luajit2.1.0-beta3目录下创建一个脚本文件,armv7编译代码如下:makecleanNDK=E:/android-ndk-r16b#ndk路径NDKABI=21NDKTRIPLE=arm-linux-androideabiNDKVER=$NDK/toolchains/$NDKTRIPLE-4.9NDKP=$NDKVER/prebuilt/win</div> </li> <li><a href="/article/1829761781208281088.htm" title="环境搭建:如何在 Windows 上安装和配置 Apache Maven 3.9.8" target="_blank">环境搭建:如何在 Windows 上安装和配置 Apache Maven 3.9.8</a> <span class="text-muted">upgrador</span> <a class="tag" taget="_blank" href="/search/%23/1.htm">#</a><a class="tag" taget="_blank" href="/search/%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/1.htm">环境搭建</a><a class="tag" taget="_blank" href="/search/windows/1.htm">windows</a><a class="tag" taget="_blank" href="/search/apache/1.htm">apache</a><a class="tag" taget="_blank" href="/search/maven/1.htm">maven</a> <div>环境搭建:如何在Windows上安装和配置ApacheMaven3.9.8在Windows系统上安装和配置ApacheMaven是开发Java应用程序的关键步骤。本文详细介绍了如何下载合适的Maven二进制文件,并正确配置环境变量,使其在命令行中可用。特别适合初学者或有类似问题的开发者参考。文章目录环境搭建:如何在Windows上安装和配置ApacheMaven3.9.8正文下载和安装步骤下载推荐</div> </li> <li><a href="/article/1829758879387447296.htm" title="2019西邮LINUX小组纳新题" target="_blank">2019西邮LINUX小组纳新题</a> <span class="text-muted">大专er</span> <a class="tag" taget="_blank" href="/search/c%E8%AF%AD%E8%A8%80/1.htm">c语言</a> <div>1.考察usigned和补码,反码等。intmain(intargc,char*argv[]){for(unsignedinti=3;i>=0;i--)putchar('=');}这个代码会输出无限个=。#includeintmain(intargc,char*argv[]){unsignedinti=3;printf("%u\n",--i);printf("%u\n",--i);printf("</div> </li> <li><a href="/article/1829748292146262016.htm" title="Linux 实时调度器:带宽限制" target="_blank">Linux 实时调度器:带宽限制</a> <span class="text-muted">JiMoKuangXiangQu</span> <a class="tag" taget="_blank" href="/search/%23/1.htm">#</a><a class="tag" taget="_blank" href="/search/%E8%BF%9B%E7%A8%8B%E8%B0%83%E5%BA%A6/1.htm">进程调度</a><a class="tag" taget="_blank" href="/search/Linux/1.htm">Linux</a><a class="tag" taget="_blank" href="/search/%E5%AE%9E%E6%97%B6%E8%B0%83%E5%BA%A6%E5%99%A8/1.htm">实时调度器</a><a class="tag" taget="_blank" href="/search/%E5%B8%A6%E5%AE%BD%E9%99%90%E5%88%B6/1.htm">带宽限制</a> <div>文章目录1.前言2.概念3.实时进程的带宽限制3.1实时进程带宽限制初始化3.2启动实时进程带宽监测定时器3.3累加实时进程消耗的带宽3.4查看实时进程带宽消耗情况3.5小结1.前言限于作者能力水平,本文可能存在谬误,因此而给读者带来的损失,作者不做任何承诺。2.概念Linux实时调度器(RTscheduler)的带宽限制,是指限制系统中实时进程占用的CPU时间的配额、比例。和实时进程打过交道的读</div> </li> <li><a href="/article/1829740732240457728.htm" title="2021西邮LINUX兴趣小组纳新题浅析" target="_blank">2021西邮LINUX兴趣小组纳新题浅析</a> <span class="text-muted">大专er</span> <a class="tag" taget="_blank" href="/search/c%E8%AF%AD%E8%A8%80/1.htm">c语言</a> <div>4.考察位运算intmain(intargc,char*argv[]){charch='A';inti=65;unsignedintf=33554433;*(int*)&f>>=24;*(int*)&f=*(int*)&f+'?';printf("ch=%ci=%cf=%c\n",ch,i,*(int*)&f);return0;}*(int*)&f>>=24;这一行将f由无符号整数强制转换为整数,</div> </li> <li><a href="/article/1829737452529610752.htm" title="Linux系统如何手动清理缓存" target="_blank">Linux系统如何手动清理缓存</a> <span class="text-muted">长弓聊编程</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>目录一.前言二.如何清理缓存一.前言我们在使用Linux系统的过程中,可能会出现系统缓存特别大,需要手动清理,那怎么清理呢,本文介绍一种方法。二.如何清理缓存在清理之前先使用命令free-h看一下当前的缓存情况是否需要清理。如果需要清理缓存,建议先使用命令sync将数据同步,然后执行echo1>/proc/sys/vm/drop_cachesecho2>/proc/sys/vm/drop_cach</div> </li> <li><a href="/article/1829737248552218624.htm" title="gcc指令" target="_blank">gcc指令</a> <span class="text-muted">萍水间人</span> <div>要弄懂命令的意思,还是需要直接去翻阅doc编译选项的作用gcc--help={common|optimizers|params|target|warnings|...Displayspecifictypesofcommandlineoptions.命令帮助的归类-E只进行预处理Preprocessonly;donotcomplie,assemble,orlink不做编译,汇编,和链接。但是不生成文</div> </li> <li><a href="/article/1829729638931329024.htm" title="FreeRTOS入坑指南" target="_blank">FreeRTOS入坑指南</a> <span class="text-muted">大熊的瓜地</span> <a class="tag" taget="_blank" href="/search/freertos/1.htm">freertos</a><a class="tag" taget="_blank" href="/search/stm32/1.htm">stm32</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/freertos/1.htm">freertos</a> <div>开发环境准备:一般平台都有自己的开发环境。例如nxp有mcuxpresso开发工具。这里我们推荐linux上的freertos模拟器。感谢GitHub-crazyskady/FreeRTOS_study:StudyforFreeRTOShttps://github.com/crazyskady/FreeRTOS_study贡献的代码,我们把代码拉到本地,增加一个tmp目录,就可以顺利编译通过。下面</div> </li> <li><a href="/article/1829723750837350400.htm" title="第四十六章 SQL命令 FROM(二)" target="_blank">第四十六章 SQL命令 FROM(二)</a> <span class="text-muted">Cache技术分享</span> <div>第四十六章SQL命令FROM(二)%PARALLEL这个可选关键字在查询的FROM子句中指定。它建议IRIS使用多个处理器(如果适用)并行处理查询。这可以显著提高使用一个或多个COUNT、SUM、AVG、MAX或MIN聚合函数和/或GROUPBY子句的某些查询的性能,以及许多其他类型的查询。这些通常是处理大量数据并返回小结果集的查询。例如,SELECTAVG(SaleAmt)FROM%PARALL</div> </li> <li><a href="/article/1829722078899695616.htm" title="RabbitMQ 入门教程" target="_blank">RabbitMQ 入门教程</a> <span class="text-muted">寂然如故</span> <a class="tag" taget="_blank" href="/search/ruby/1.htm">ruby</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a><a class="tag" taget="_blank" href="/search/%E5%90%8E%E7%AB%AF/1.htm">后端</a> <div>概述RabbitMQ是一个开源的消息代理和队列服务器,实现了AMQP0-9-1标准。它可以在完全不同的应用程序之间传递消息。本教程将带你从零开始学习如何使用RabbitMQ。环境准备1.安装RabbitMQ-在命令行中运行`sudoapt-getinstallrabbitmq-server`(Ubuntu)或者通过官方文档获取其他系统的安装指南。2.启动服务-运行`sudoservicerabbi</div> </li> <li><a href="/article/1829722079348486144.htm" title="RabbitMQ 入门教程" target="_blank">RabbitMQ 入门教程</a> <span class="text-muted">寂然如故</span> <a class="tag" taget="_blank" href="/search/rabbitmq/1.htm">rabbitmq</a><a class="tag" taget="_blank" href="/search/%E5%88%86%E5%B8%83%E5%BC%8F/1.htm">分布式</a> <div>介绍RabbitMQ是一个开源的消息代理和队列服务器,实现了AMQP0-9-1标准。它支持多种消息协议,并且可以在各种环境中运行。安装与配置1.安装RabbitMQLinux(Ubuntu/Debian)```bashsudoaptupdatesudoaptinstallrabbitmq-server```Windows-下载并安装[RabbitMQServer](https://www.rabb</div> </li> <li><a href="/article/1829718301320769536.htm" title="5G SPS配置" target="_blank">5G SPS配置</a> <span class="text-muted">cuisidong1997</span> <a class="tag" taget="_blank" href="/search/5G/1.htm">5G</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a> <div>‌SPS配置‌是一种技术,用于管理和优化数据传输,特别是在无线通信领域。它涉及到为特定的数据传输需求确定最佳的参数配置,以满足不同的传输需求。SPS配置的参数包括时域资源分配、调制编码方式、频域资源分配、虚拟资源块到物理资源块的映射方式、传输功率控制命令以及传输信道到HARQ-ACK的定时间隔等。这些参数的配置旨在提高传输效率和数据质量,同时确保数据传输的可靠性和稳定性。在实施SPS配置时,关键在</div> </li> <li><a href="/article/1829718175105773568.htm" title="openwrt 21.02 开启ntfs-3g自动挂载2T以上移动硬盘" target="_blank">openwrt 21.02 开启ntfs-3g自动挂载2T以上移动硬盘</a> <span class="text-muted">FoxMale007</span> <a class="tag" taget="_blank" href="/search/%E6%9C%AA%E6%95%B4%E7%90%86%E9%9A%8F%E7%AC%94/1.htm">未整理随笔</a><a class="tag" taget="_blank" href="/search/openwrt/1.htm">openwrt</a><a class="tag" taget="_blank" href="/search/ntfs-3g/1.htm">ntfs-3g</a><a class="tag" taget="_blank" href="/search/U%E7%9B%98/1.htm">U盘</a><a class="tag" taget="_blank" href="/search/%E7%A7%BB%E5%8A%A8%E7%A1%AC%E7%9B%98/1.htm">移动硬盘</a><a class="tag" taget="_blank" href="/search/NAS/1.htm">NAS</a> <div>初始状态:openwrt21.02原始版本需求:需要自动挂载移动硬盘,作为简单NAS使用遇到问题:1)按照网上教程mount命令不识别uuid参数,发现少安装了一个包:mount-utils2)不想用最新的ntfs工具,使用旧的ntfs-3g兼容性更好,而且挂载2T以上移动硬盘必须使用ntfs-3g。但是问题是,开启了使用UUID挂载点后,死活挂载不上。最后发现是最新openwrt源码里有个BUG</div> </li> <li><a href="/article/1829711121527959552.htm" title="Linux NTP 服务器时间自动同步配置" target="_blank">Linux NTP 服务器时间自动同步配置</a> <span class="text-muted">冰美式多加冰</span> <a class="tag" taget="_blank" href="/search/%5BLinux%E5%9F%BA%E7%A1%80%E8%BF%90%E7%BB%B4%5D/1.htm">[Linux基础运维]</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E5%8E%9F%E7%94%9F/1.htm">云原生</a><a class="tag" taget="_blank" href="/search/devops/1.htm">devops</a> <div>本文以CentOS7.x为准,由于系统默认时间同步服务器都在国外在某种原因下无法及时同步时间,最好的选择就是设置国内时间服务器地址进行同步。不用想了,当然国内某些云厂商提供的免费时间服务器是首选开干1.编辑配置文件sudovim/etc/ntp.conf找到服务器地址位置添加阿里云免费NTP地址,大概是这样的19#Usepublicserversfromthepool.ntp.orgproject</div> </li> <li><a href="/article/1829702797617098752.htm" title="Java 如何实现一个简单 RabbitMQ 示例" target="_blank">Java 如何实现一个简单 RabbitMQ 示例</a> <span class="text-muted">青灯文案</span> <a class="tag" taget="_blank" href="/search/%E4%B8%AD%E9%97%B4%E4%BB%B6/1.htm">中间件</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/rabbitmq/1.htm">rabbitmq</a> <div>本文建立在你在Linux上完成安装RabbitMQ的基础上。1、生产者代码顾名思义,生产者是用来生产消息供消费者消费packagecom.wen.rabbitmq;importcom.rabbitmq.client.Channel;importcom.rabbitmq.client.Connection;importcom.rabbitmq.client.ConnectionFactory;imp</div> </li> <li><a href="/article/1829700399255351296.htm" title="如何生成Python的 .pyc 文件" target="_blank">如何生成Python的 .pyc 文件</a> <span class="text-muted">常家壮</span> <a class="tag" taget="_blank" href="/search/%23/1.htm">#</a><a class="tag" taget="_blank" href="/search/Python/1.htm">Python</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a><a class="tag" taget="_blank" href="/search/.pyc/1.htm">.pyc</a><a class="tag" taget="_blank" href="/search/%E7%BC%96%E7%A8%8B/1.htm">编程</a><a class="tag" taget="_blank" href="/search/%E4%BA%86%E8%A7%A3%E7%9A%84%E7%9F%A5%E8%AF%86/1.htm">了解的知识</a> <div>生成Python的pyc文件可以使用Python内置的模块如py_compile和compileall,通过编译源代码(.py文件)来生成字节码文件(.pyc文件)什么是.pyc这里不在赘述下面将详细分析如何手动和批量生成pyc文件:1.使用py_compile模块生成单个.pyc文件命令行方式:利用Python的命令行参数,可以快速将单个.py文件编译为.pyc文件。例如,使用命令python3</div> </li> <li><a href="/article/1829700146238156800.htm" title="Java算法之希尔排序(Shell Sort)" target="_blank">Java算法之希尔排序(Shell Sort)</a> <span class="text-muted">持续输出...</span> <a class="tag" taget="_blank" href="/search/%23/1.htm">#</a><a class="tag" taget="_blank" href="/search/Java/1.htm">Java</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95/1.htm">排序算法</a> <div>简介希尔排序,又称为缩小增量排序,是插入排序的一种改进算法。它通过引入增量序列,将原始数据序列分成多个子序列,对每个子序列进行插入排序,然后逐渐减小增量,直到增量为1,完成整个排序过程。算法步骤选择一个增量序列,例如初始时为数组长度的一半。将数组分为多个子序列,每个子序列的元素间隔为增量序列的第一个值。对每个子序列进行直接插入排序。逐步减小增量序列的值,重复步骤2和3,直到增量为1。//shell</div> </li> <li><a href="/article/1829699892642148352.htm" title="Linux 命令行快捷键" target="_blank">Linux 命令行快捷键</a> <span class="text-muted">sun007700</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a> <div>Linux命令行快捷键_linux删除一个单词-CSDN博客涉及在linux命令行下进行快速移动光标、命令编辑、编辑后执行历史命令、Bang(!)命令、控制命令等。让basher更有效率。常用Ctrl+左右键:在单词之间跳转Ctrl+a:跳到本行的行首Ctrl+e:跳到页尾Ctrl+u:删除当前光标前面的文字(还有剪切功能)Ctrl+k:删除当前光标后面的文字(还有剪切功能)Ctrl+y:粘贴Ct</div> </li> <li><a href="/article/1829696633227538432.htm" title="Linux下Caffe、Docker、Tensorflow、PyTorch环境搭建(CentOS 7)" target="_blank">Linux下Caffe、Docker、Tensorflow、PyTorch环境搭建(CentOS 7)</a> <span class="text-muted">SnailTyan</span> <div>文章作者:Tyan博客:noahsnail.com|CSDN|注:模型的训练、测试、部署都可以通过Docker环境完成,环境问题会更少。1.CUDA8.0安装CUDA8.0Configenvvariables#CUDAPATHexportPATH="/usr/local/cuda-8.0/bin:$PATH"#CUDALDLIBRARY_PATHexportLD_LIBRARY_PATH="/us</div> </li> <li><a href="/article/1829689674105450496.htm" title="CUDA 问题解决 —— CUDA+MPI出错:"mpi.h" No such file or directory" target="_blank">CUDA 问题解决 —— CUDA+MPI出错:"mpi.h" No such file or directory</a> <span class="text-muted">__Sunny__</span> <a class="tag" taget="_blank" href="/search/CUDA/1.htm">CUDA</a><a class="tag" taget="_blank" href="/search/cuda/1.htm">cuda</a><a class="tag" taget="_blank" href="/search/c%E8%AF%AD%E8%A8%80/1.htm">c语言</a> <div>在CUDA源文件里使用MPI时,编译出错Makefile文件:CUDA_INSTALL_PATH=/usr/local/cuda-8.0MPI_INSTALL_PATH=/opt/intel/compilers_and_libraries_2017.0.098/linux/mpi/intel64NVCC=$(CUDA_INSTALL_PATH)/bin/nvccMPICC=$(MPI_INSTAL</div> </li> <li><a href="/article/1829679966279790592.htm" title="c++命令模式" target="_blank">c++命令模式</a> <span class="text-muted">激昂~逐流</span> <a class="tag" taget="_blank" href="/search/C%2B%2B%E7%9B%B8%E5%85%B3/1.htm">C++相关</a><a class="tag" taget="_blank" href="/search/c%2B%2B/1.htm">c++</a><a class="tag" taget="_blank" href="/search/%E5%91%BD%E4%BB%A4%E6%A8%A1%E5%BC%8F/1.htm">命令模式</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a> <div>一.概念命令模式(CommandPattern)是一种行为设计模式,它将请求封装为对象,从而使您可以使用不同的请求、队列或日志请求,以及支持可撤销操作。命令模式的主要组成部分包括:命令接口(CommandInterface):定义一个执行操作的接口。具体命令(ConcreteCommand):实现命令接口,定义与接收者之间的绑定关系。接收者(Receiver):知道如何实施与执行相关的操作。调用者</div> </li> <li><a href="/article/1829678957109276672.htm" title="OSG Viewer输入按键无响应" target="_blank">OSG Viewer输入按键无响应</a> <span class="text-muted">yann_qu</span> <a class="tag" taget="_blank" href="/search/OpenSceneGraph/1.htm">OpenSceneGraph</a><a class="tag" taget="_blank" href="/search/OSG/1.htm">OSG</a><a class="tag" taget="_blank" href="/search/osgEarth/1.htm">osgEarth</a> <div>OSGViewer输入按键无响应1问题描述操作系统:Windows1022H2输入法:微软拼音输入法现象:在PowerShell执行osgviewer.exeglider.osg后,能正常显示图像,但输入s(显示帧率)或f(切换全屏或窗口)等按键后无响应。2解决方案右键点击任务栏右下角输入法图标,点击设置-常规,在兼容性一栏中启用使用以前版本的微软拼音输入法。</div> </li> <li><a href="/article/1829671895541313536.htm" title="Centos7-Linux下载安装Redis超详细图文教程" target="_blank">Centos7-Linux下载安装Redis超详细图文教程</a> <span class="text-muted">西风小焦</span> <a class="tag" taget="_blank" href="/search/redis/1.htm">redis</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E7%BC%93%E5%AD%98/1.htm">缓存</a><a class="tag" taget="_blank" href="/search/centos/1.htm">centos</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a> <div>本文主要介绍如何在centos7服务器下安装redis已经启动运行的全部过程Centos7-Linux下载安装Redis图文教程安装步骤1.检查服务器上是否安装了gcc2.下载redis安装包上传服务器并解压3.解压文件并安装4.启动并运行服务5.设置开机自启动6.连接Redis问题7.测试连接8.关闭Redis9.总结安装步骤1.检查服务器上是否安装了gccredis是由C语言开发,因此安装之前</div> </li> <li><a href="/article/1829669878425022464.htm" title="在Ubuntu 18.04上安装MySQL的方法" target="_blank">在Ubuntu 18.04上安装MySQL的方法</a> <span class="text-muted">白如意i</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/ubuntu/1.htm">ubuntu</a><a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到网站。介绍MySQL是一个开源的数据库管理系统,通常作为流行的LAMP(Linux、Apache、MySQL、PHP/Python/Perl)堆栈的一部分安装。它使用关系数据库和SQL(结构化查询语言)来管理数据。安装的简短版本很简单:更新软件包索引,安装mysql-server软件包,然后运行附带的安全脚</div> </li> <li><a href="/article/1829669374252904448.htm" title="CentOS 7下载Redis详细步骤(必行)" target="_blank">CentOS 7下载Redis详细步骤(必行)</a> <span class="text-muted">闹心zero</span> <a class="tag" taget="_blank" href="/search/redis/1.htm">redis</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/centos/1.htm">centos</a> <div>系列文章如果已经安装完毕,可以自定义启动redis,看此文章:Redis常用自定义配置(基于Linux环境)在CentOS7上将Redis下载到/usr/local目录并安装、启动、关闭的详细步骤如下:1.安装gcc编译器和make工具(已安装跳过)在CentOS7上安装Redis需要gcc编译器和make工具,如果没有安装,可以使用以下命令安装:sudoyuminstallgccmake2.下载</div> </li> <li><a href="/article/1829666096295276544.htm" title="Redis入门篇 - CentOS 7下载、安装Redis实操演示" target="_blank">Redis入门篇 - CentOS 7下载、安装Redis实操演示</a> <span class="text-muted">ChineHe</span> <a class="tag" taget="_blank" href="/search/Redis/1.htm">Redis</a><a class="tag" taget="_blank" href="/search/redis/1.htm">redis</a><a class="tag" taget="_blank" href="/search/centos/1.htm">centos</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a> <div>文章记录了在CentOS7上,通过源码的形式,下载安装Redis的操作过程进入要安装Redis的目录cd/usr/local下载源码压缩包wgethttps://download.redis.io/redis-stable.tar.gz#不同版本可能地址不同下载完成后,使用ll命令检查,可以看到下载的压缩包:下载完成后,解压下载的压缩包tar-xzvfredis-stable.tar.gz解压完成</div> </li> <li><a href="/article/123.htm" title="js动画html标签(持续更新中)" target="_blank">js动画html标签(持续更新中)</a> <span class="text-muted">843977358</span> <a class="tag" taget="_blank" href="/search/html/1.htm">html</a><a class="tag" taget="_blank" href="/search/js/1.htm">js</a><a class="tag" taget="_blank" href="/search/%E5%8A%A8%E7%94%BB/1.htm">动画</a><a class="tag" taget="_blank" href="/search/media/1.htm">media</a><a class="tag" taget="_blank" href="/search/opacity/1.htm">opacity</a> <div>1.jQuery 效果 - animate() 方法    改变 "div" 元素的高度:    $(".btn1").click(function(){      $("#box").animate({height:"300px</div> </li> <li><a href="/article/250.htm" title="springMVC学习笔记" target="_blank">springMVC学习笔记</a> <span class="text-muted">caoyong</span> <a class="tag" taget="_blank" href="/search/springMVC/1.htm">springMVC</a> <div>1、搭建开发环境    a>、添加jar文件,在ioc所需jar包的基础上添加spring-web.jar,spring-webmvc.jar    b>、在web.xml中配置前端控制器       <servlet>     &nbs</div> </li> <li><a href="/article/377.htm" title="POI中设置Excel单元格格式" target="_blank">POI中设置Excel单元格格式</a> <span class="text-muted">107x</span> <a class="tag" taget="_blank" href="/search/poi/1.htm">poi</a><a class="tag" taget="_blank" href="/search/style/1.htm">style</a><a class="tag" taget="_blank" href="/search/%E5%88%97%E5%AE%BD/1.htm">列宽</a><a class="tag" taget="_blank" href="/search/%E5%90%88%E5%B9%B6%E5%8D%95%E5%85%83%E6%A0%BC/1.htm">合并单元格</a><a class="tag" taget="_blank" href="/search/%E8%87%AA%E5%8A%A8%E6%8D%A2%E8%A1%8C/1.htm">自动换行</a> <div>引用:http://apps.hi.baidu.com/share/detail/17249059 POI中可能会用到一些需要设置EXCEL单元格格式的操作小结: 先获取工作薄对象: HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); HSSFCellStyle setBorder = wb.</div> </li> <li><a href="/article/504.htm" title="jquery 获取A href 触发js方法的this参数 无效的情况" target="_blank">jquery 获取A href 触发js方法的this参数 无效的情况</a> <span class="text-muted">一炮送你回车库</span> <a class="tag" taget="_blank" href="/search/jquery/1.htm">jquery</a> <div>html如下:  <td class=\"bord-r-n bord-l-n c-333\"> <a class=\"table-icon edit\" onclick=\"editTrValues(this);\">修改</a> </td>"   j</div> </li> <li><a href="/article/631.htm" title="md5" target="_blank">md5</a> <span class="text-muted">3213213333332132</span> <a class="tag" taget="_blank" href="/search/MD5/1.htm">MD5</a> <div> import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class MDFive { public static void main(String[] args) { String md5Str = "cq</div> </li> <li><a href="/article/758.htm" title="完全卸载干净Oracle11g" target="_blank">完全卸载干净Oracle11g</a> <span class="text-muted">sophia天雪</span> <a class="tag" taget="_blank" href="/search/orale%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">orale数据库</a><a class="tag" taget="_blank" href="/search/%E5%8D%B8%E8%BD%BD%E5%B9%B2%E5%87%80/1.htm">卸载干净</a><a class="tag" taget="_blank" href="/search/%E6%B8%85%E7%90%86%E6%B3%A8%E5%86%8C%E8%A1%A8/1.htm">清理注册表</a> <div>完全卸载干净Oracle11g A、存在OUI卸载工具的情况下:     第一步:停用所有Oracle相关的已启动的服务;     第二步:找到OUI卸载工具:在“开始”菜单中找到“oracle_OraDb11g_home”文件夹中         &</div> </li> <li><a href="/article/885.htm" title="apache 的access.log 日志文件太大如何解决" target="_blank">apache 的access.log 日志文件太大如何解决</a> <span class="text-muted">darkranger</span> <a class="tag" taget="_blank" href="/search/apache/1.htm">apache</a> <div>CustomLog logs/access.log common  此写法导致日志数据一致自增变大。 直接注释上面的语法 #CustomLog logs/access.log common 增加: CustomLog "|bin/rotatelogs.exe -l logs/access-%Y-%m-d.log </div> </li> <li><a href="/article/1012.htm" title="Hadoop单机模式环境搭建关键步骤" target="_blank">Hadoop单机模式环境搭建关键步骤</a> <span class="text-muted">aijuans</span> <a class="tag" taget="_blank" href="/search/%E5%88%86%E5%B8%83%E5%BC%8F/1.htm">分布式</a> <div>        Hadoop环境需要sshd服务一直开启,故,在服务器上需要按照ssh服务,以Ubuntu Linux为例,按照ssh服务如下: sudo apt-get install ssh sudo apt-get install rsync 编辑HADOOP_HOME/conf/hadoop-env.sh文件,将JAVA_HOME设置为Java</div> </li> <li><a href="/article/1139.htm" title="PL/SQL DEVELOPER 使用的一些技巧" target="_blank">PL/SQL DEVELOPER 使用的一些技巧</a> <span class="text-muted">atongyeye</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/sql/1.htm">sql</a> <div>1 记住密码 这是个有争议的功能,因为记住密码会给带来数据安全的问题。 但假如是开发用的库,密码甚至可以和用户名相同,每次输入密码实在没什么意义,可以考虑让PLSQL Developer记住密码。 位置:Tools菜单--Preferences--Oracle--Logon HIstory--Store with password 2 特殊Copy 在SQL Window</div> </li> <li><a href="/article/1266.htm" title="PHP:在对象上动态添加一个新的方法" target="_blank">PHP:在对象上动态添加一个新的方法</a> <span class="text-muted">bardo</span> <a class="tag" taget="_blank" href="/search/%E6%96%B9%E6%B3%95/1.htm">方法</a><a class="tag" taget="_blank" href="/search/%E5%8A%A8%E6%80%81%E6%B7%BB%E5%8A%A0/1.htm">动态添加</a><a class="tag" taget="_blank" href="/search/%E9%97%AD%E5%8C%85/1.htm">闭包</a> <div>有关在一个对象上动态添加方法,如果你来自Ruby语言或您熟悉这门语言,你已经知道它是什么...... Ruby提供给你一种方式来获得一个instancied对象,并给这个对象添加一个额外的方法。   好!不说Ruby了,让我们来谈谈PHP   PHP未提供一个“标准的方式”做这样的事情,这也是没有核心的一部分...   但无论如何,它并没有说我们不能做这样</div> </li> <li><a href="/article/1393.htm" title="ThreadLocal与线程安全" target="_blank">ThreadLocal与线程安全</a> <span class="text-muted">bijian1013</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/java%E5%A4%9A%E7%BA%BF%E7%A8%8B/1.htm">java多线程</a><a class="tag" taget="_blank" href="/search/threadLocal/1.htm">threadLocal</a> <div>首先来看一下线程安全问题产生的两个前提条件:  1.数据共享,多个线程访问同样的数据。  2.共享数据是可变的,多个线程对访问的共享数据作出了修改。    实例:         定义一个共享数据: public static int a = 0;         </div> </li> <li><a href="/article/1520.htm" title="Tomcat 架包冲突解决" target="_blank">Tomcat 架包冲突解决</a> <span class="text-muted">征客丶</span> <a class="tag" taget="_blank" href="/search/tomcat/1.htm">tomcat</a><a class="tag" taget="_blank" href="/search/Web/1.htm">Web</a> <div>环境: Tomcat 7.0.6 win7 x64 错误表象:【我的冲突的架包是:catalina.jar 与 tomcat-catalina-7.0.61.jar 冲突,不知道其他架包冲突时是不是也报这个错误】 严重: End event threw exception java.lang.NoSuchMethodException: org.apache.catalina.dep</div> </li> <li><a href="/article/1647.htm" title="【Scala三】分析Spark源代码总结的Scala语法一" target="_blank">【Scala三】分析Spark源代码总结的Scala语法一</a> <span class="text-muted">bit1129</span> <a class="tag" taget="_blank" href="/search/scala/1.htm">scala</a> <div>Scala语法 1. classOf运算符 Scala中的classOf[T]是一个class对象,等价于Java的T.class,比如classOf[TextInputFormat]等价于TextInputFormat.class    2. 方法默认值 defaultMinPartitions就是一个默认值,类似C++的方法默认值     </div> </li> <li><a href="/article/1774.htm" title="java 线程池管理机制" target="_blank">java 线程池管理机制</a> <span class="text-muted">BlueSkator</span> <a class="tag" taget="_blank" href="/search/java%E7%BA%BF%E7%A8%8B%E6%B1%A0/1.htm">java线程池</a><a class="tag" taget="_blank" href="/search/%E7%AE%A1%E7%90%86%E6%9C%BA%E5%88%B6/1.htm">管理机制</a> <div>编辑 Add Tools   jdk线程池   一、引言 第一:降低资源消耗。通过重复利用已创建的线程降低线程创建和销毁造成的消耗。第二:提高响应速度。当任务到达时,任务可以不需要等到线程创建就能立即执行。第三:提高线程的可管理性。线程是稀缺资源,如果无限制的创建,不仅会消耗系统资源,还会降低系统的稳定性,使用线程池可以进行统一的分配,调优和监控。   </div> </li> <li><a href="/article/1901.htm" title="关于hql中使用本地sql函数的问题(问-答)" target="_blank">关于hql中使用本地sql函数的问题(问-答)</a> <span class="text-muted">BreakingBad</span> <a class="tag" taget="_blank" href="/search/HQL/1.htm">HQL</a><a class="tag" taget="_blank" href="/search/%E5%AD%98%E5%82%A8%E5%87%BD%E6%95%B0/1.htm">存储函数</a> <div>转自于:http://www.iteye.com/problems/23775 问: 我在开发过程中,使用hql进行查询(mysql5)使用到了mysql自带的函数find_in_set()这个函数作为匹配字符串的来讲效率非常好,但是我直接把它写在hql语句里面(from ForumMemberInfo fm,ForumArea fa where find_in_set(fm.userId,f</div> </li> <li><a href="/article/2028.htm" title="读《研磨设计模式》-代码笔记-迭代器模式-Iterator" target="_blank">读《研磨设计模式》-代码笔记-迭代器模式-Iterator</a> <span class="text-muted">bylijinnan</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/1.htm">设计模式</a> <div>声明: 本文只为方便我个人查阅和理解,详细的分析以及源代码请移步 原作者的博客http://chjavach.iteye.com/ import java.util.Arrays; import java.util.List; /** * Iterator模式提供一种方法顺序访问一个聚合对象中各个元素,而又不暴露该对象内部表示 * * 个人觉得,为了不暴露该</div> </li> <li><a href="/article/2155.htm" title="常用SQL" target="_blank">常用SQL</a> <span class="text-muted">chenjunt3</span> <a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a><a class="tag" taget="_blank" href="/search/sql/1.htm">sql</a><a class="tag" taget="_blank" href="/search/C%2B%2B/1.htm">C++</a><a class="tag" taget="_blank" href="/search/c/1.htm">c</a><a class="tag" taget="_blank" href="/search/C%23/1.htm">C#</a> <div> --NC建库 CREATE TABLESPACE NNC_DATA01 DATAFILE 'E:\oracle\product\10.2.0\oradata\orcl\nnc_data01.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K ; CREATE TABLESPA</div> </li> <li><a href="/article/2282.htm" title="数学是科学技术的语言" target="_blank">数学是科学技术的语言</a> <span class="text-muted">comsci</span> <a class="tag" taget="_blank" href="/search/%E5%B7%A5%E4%BD%9C/1.htm">工作</a><a class="tag" taget="_blank" href="/search/%E6%B4%BB%E5%8A%A8/1.htm">活动</a><a class="tag" taget="_blank" href="/search/%E9%A2%86%E5%9F%9F%E6%A8%A1%E5%9E%8B/1.htm">领域模型</a> <div>  从小学到大学都在学习数学,从小学开始了解数字的概念和背诵九九表到大学学习复变函数和离散数学,看起来好像掌握了这些数学知识,但是在工作中却很少真正用到这些知识,为什么?    最近在研究一种开源软件-CARROT2的源代码的时候,又一次感觉到数学在计算机技术中的不可动摇的基础作用,CARROT2是一种用于自动语言分类(聚类)的工具性软件,用JAVA语言编写,它</div> </li> <li><a href="/article/2409.htm" title="Linux系统手动安装rzsz 软件包" target="_blank">Linux系统手动安装rzsz 软件包</a> <span class="text-muted">daizj</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/sz/1.htm">sz</a><a class="tag" taget="_blank" href="/search/rz/1.htm">rz</a> <div>1、下载软件 rzsz-3.34.tar.gz。登录linux,用命令 wget http://freeware.sgi.com/source/rzsz/rzsz-3.48.tar.gz下载。 2、解压 tar zxvf  rzsz-3.34.tar.gz 3、安装  cd rzsz-3.34 ; make posix 。注意:这个软件安装与常规的GNU软件不</div> </li> <li><a href="/article/2536.htm" title="读源码之:ArrayBlockingQueue" target="_blank">读源码之:ArrayBlockingQueue</a> <span class="text-muted">dieslrae</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a> <div>    ArrayBlockingQueue是concurrent包提供的一个线程安全的队列,由一个数组来保存队列元素.通过 takeIndex和 putIndex来分别记录出队列和入队列的下标,以保证在出队列时 不进行元素移动. //在出队列或者入队列的时候对takeIndex或者putIndex进行累加,如果已经到了数组末尾就又从0开始,保证数</div> </li> <li><a href="/article/2663.htm" title="C语言学习九枚举的定义和应用" target="_blank">C语言学习九枚举的定义和应用</a> <span class="text-muted">dcj3sjt126com</span> <a class="tag" taget="_blank" href="/search/c/1.htm">c</a> <div>枚举的定义 # include <stdio.h> enum WeekDay { MonDay, TuesDay, WednesDay, ThursDay, FriDay, SaturDay, SunDay }; int main(void) { //int day; //day定义成int类型不合适 enum WeekDay day = Wedne</div> </li> <li><a href="/article/2790.htm" title="Vagrant 三种网络配置详解" target="_blank">Vagrant 三种网络配置详解</a> <span class="text-muted">dcj3sjt126com</span> <a class="tag" taget="_blank" href="/search/vagrant/1.htm">vagrant</a> <div> Forwarded port Private network Public network Vagrant 中一共有三种网络配置,下面我们将会详解三种网络配置各自优缺点。 端口映射(Forwarded port),顾名思义是指把宿主计算机的端口映射到虚拟机的某一个端口上,访问宿主计算机端口时,请求实际是被转发到虚拟机上指定端口的。Vagrantfile中设定语法为: c</div> </li> <li><a href="/article/2917.htm" title="16.性能优化-完结" target="_blank">16.性能优化-完结</a> <span class="text-muted">frank1234</span> <a class="tag" taget="_blank" href="/search/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/1.htm">性能优化</a> <div>性能调优是一个宏大的工程,需要从宏观架构(比如拆分,冗余,读写分离,集群,缓存等), 软件设计(比如多线程并行化,选择合适的数据结构), 数据库设计层面(合理的表设计,汇总表,索引,分区,拆分,冗余等) 以及微观(软件的配置,SQL语句的编写,操作系统配置等)根据软件的应用场景做综合的考虑和权衡,并经验实际测试验证才能达到最优。 性能水很深, 笔者经验尚浅 ,赶脚也就了解了点皮毛而已,我觉得</div> </li> <li><a href="/article/3044.htm" title="Word Search" target="_blank">Word Search</a> <span class="text-muted">hcx2013</span> <a class="tag" taget="_blank" href="/search/search/1.htm">search</a> <div>Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or ve</div> </li> <li><a href="/article/3171.htm" title="Spring4新特性——Web开发的增强" target="_blank">Spring4新特性——Web开发的增强</a> <span class="text-muted">jinnianshilongnian</span> <a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/spring+mvc/1.htm">spring mvc</a><a class="tag" taget="_blank" href="/search/spring4/1.htm">spring4</a> <div>Spring4新特性——泛型限定式依赖注入 Spring4新特性——核心容器的其他改进 Spring4新特性——Web开发的增强 Spring4新特性——集成Bean Validation 1.1(JSR-349)到SpringMVC  Spring4新特性——Groovy Bean定义DSL Spring4新特性——更好的Java泛型操作API  Spring4新</div> </li> <li><a href="/article/3298.htm" title="CentOS安装配置tengine并设置开机启动" target="_blank">CentOS安装配置tengine并设置开机启动</a> <span class="text-muted">liuxingguome</span> <a class="tag" taget="_blank" href="/search/centos/1.htm">centos</a> <div>yum install gcc-c++  yum install pcre pcre-devel  yum install zlib zlib-devel  yum install openssl openssl-devel Ubuntu上可以这样安装 sudo aptitude install libdmalloc-dev libcurl4-opens</div> </li> <li><a href="/article/3425.htm" title="第14章 工具函数(上)" target="_blank">第14章 工具函数(上)</a> <span class="text-muted">onestopweb</span> <a class="tag" taget="_blank" href="/search/%E5%87%BD%E6%95%B0/1.htm">函数</a> <div>index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/</div> </li> <li><a href="/article/3552.htm" title="Xelsius 2008 and SAP BW at a glance" target="_blank">Xelsius 2008 and SAP BW at a glance</a> <span class="text-muted">blueoxygen</span> <a class="tag" taget="_blank" href="/search/BO/1.htm">BO</a><a class="tag" taget="_blank" href="/search/Xelsius/1.htm">Xelsius</a> <div>Xelsius提供了丰富多样的数据连接方式,其中为SAP BW专属提供的是BICS。那么Xelsius的各种连接的优缺点比较以及Xelsius是如何直接连接到BEx Query的呢? 以下Wiki文章应该提供了全面的概览。   http://wiki.sdn.sap.com/wiki/display/BOBJ/Xcelsius+2008+and+SAP+NetWeaver+BW+Co</div> </li> <li><a href="/article/3679.htm" title="oracle表空间相关" target="_blank">oracle表空间相关</a> <span class="text-muted">tongsh6</span> <a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a> <div>在oracle数据库中,一个用户对应一个表空间,当表空间不足时,可以采用增加表空间的数据文件容量,也可以增加数据文件,方法有如下几种: 1.给表空间增加数据文件    ALTER TABLESPACE "表空间的名字" ADD DATAFILE    '表空间的数据文件路径' SIZE 50M;   &nb</div> </li> <li><a href="/article/3806.htm" title=".Net framework4.0安装失败" target="_blank">.Net framework4.0安装失败</a> <span class="text-muted">yangjuanjava</span> <a class="tag" taget="_blank" href="/search/.net/1.htm">.net</a><a class="tag" taget="_blank" href="/search/windows/1.htm">windows</a> <div>上午的.net framework 4.0,各种失败,查了好多答案,各种不靠谱,最后终于找到答案了 和Windows Update有关系,给目录名重命名一下再次安装,即安装成功了! 下载地址:http://www.microsoft.com/en-us/download/details.aspx?id=17113 方法: 1.运行cmd,输入net stop WuAuServ 2.点击开</div> </li> </ul> </div> </div> </div> <div> <div class="container"> <div class="indexes"> <strong>按字母分类:</strong> <a href="/tags/A/1.htm" target="_blank">A</a><a href="/tags/B/1.htm" target="_blank">B</a><a href="/tags/C/1.htm" target="_blank">C</a><a href="/tags/D/1.htm" target="_blank">D</a><a href="/tags/E/1.htm" target="_blank">E</a><a href="/tags/F/1.htm" target="_blank">F</a><a href="/tags/G/1.htm" target="_blank">G</a><a href="/tags/H/1.htm" target="_blank">H</a><a href="/tags/I/1.htm" target="_blank">I</a><a href="/tags/J/1.htm" target="_blank">J</a><a href="/tags/K/1.htm" target="_blank">K</a><a href="/tags/L/1.htm" target="_blank">L</a><a href="/tags/M/1.htm" target="_blank">M</a><a href="/tags/N/1.htm" target="_blank">N</a><a href="/tags/O/1.htm" target="_blank">O</a><a href="/tags/P/1.htm" target="_blank">P</a><a href="/tags/Q/1.htm" target="_blank">Q</a><a href="/tags/R/1.htm" target="_blank">R</a><a href="/tags/S/1.htm" target="_blank">S</a><a href="/tags/T/1.htm" target="_blank">T</a><a href="/tags/U/1.htm" target="_blank">U</a><a href="/tags/V/1.htm" target="_blank">V</a><a href="/tags/W/1.htm" target="_blank">W</a><a href="/tags/X/1.htm" target="_blank">X</a><a href="/tags/Y/1.htm" target="_blank">Y</a><a href="/tags/Z/1.htm" target="_blank">Z</a><a href="/tags/0/1.htm" target="_blank">其他</a> </div> </div> </div> <footer id="footer" class="mb30 mt30"> <div class="container"> <div class="footBglm"> <a target="_blank" href="/">首页</a> - <a target="_blank" href="/custom/about.htm">关于我们</a> - <a target="_blank" href="/search/Java/1.htm">站内搜索</a> - <a target="_blank" href="/sitemap.txt">Sitemap</a> - <a target="_blank" href="/custom/delete.htm">侵权投诉</a> </div> <div class="copyright">版权所有 IT知识库 CopyRight © 2000-2050 E-COM-NET.COM , All Rights Reserved. <!-- <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">京ICP备09083238号</a><br>--> </div> </div> </footer> <!-- 代码高亮 --> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shCore.js"></script> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shLegacy.js"></script> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shAutoloader.js"></script> <link type="text/css" rel="stylesheet" href="/static/syntaxhighlighter/styles/shCoreDefault.css"/> <script type="text/javascript" src="/static/syntaxhighlighter/src/my_start_1.js"></script> </body> </html>