摘要: 基本C库函数当编写驱动程序时,一般情况下不能使用C标准库的函数。Linux内核也提供了与标准库函数功能相同的一些函数,但二者还是稍有差别。类别函数名功能函数形成参数描述字符串转换simple_strtol把一个字符串转换为一个有符号长整数long simple_strtol (const char * cp, char ** endp, unsigned int base)cp指向字符串的开始,endp为指向要分析的字符串末尾处的位置,base为要用的基数。simple_strtoll把一个字符串转换为一个有符号长长整数long long simple_strtoll (const char 阅读全文
posted @ 2013-12-07 22:26 茶陵后 阅读(196) 评论(0) 推荐(0)
摘要: 1 #!/bin/bash 2 3 echo "Enter password:" 4 read password 5 6 while [ "$password" != "123" ]; 7 do 8 echo "Sorry, try again." 9 read password10 done11 exit 0View Code 阅读全文
posted @ 2013-12-07 14:46 茶陵后 阅读(79) 评论(0) 推荐(0)
摘要: 1 #!/bin/bash 2 3 for file in $TEST*/; 4 do 5 echo "-------------" 6 pwd 7 echo "-------------" 8 cd $file 9 pwd10 echo "-------------"11 echo './go'12 cd ..13 ... 阅读全文
posted @ 2013-12-07 13:14 茶陵后 阅读(650) 评论(1) 推荐(0)