随笔分类 -  shell编程杂碎的东西

摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> union { int n; double x; }num; int main() { num.n = 10; num.x = 10.5; printf("num.n is %d\n 阅读全文
posted @ 2021-10-04 16:33 卷哭你 阅读(85) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> #define NUM 4 struct student { int rank; char* name; float score; }; struct student stu[] = 阅读全文
posted @ 2021-10-04 16:03 卷哭你 阅读(82) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> static struct s1 { char c[4]; char* s; }s1 = {"abc","def"}; static struct s2 { char* cp; st 阅读全文
posted @ 2021-10-04 15:15 卷哭你 阅读(67) 评论(0) 推荐(0)
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h>#define M 100struct data{ int id; char name[20]; double price;}book[M];//在有M个元素的结构体数组s中查找名为nam 阅读全文
posted @ 2021-10-04 14:49 卷哭你 阅读(123) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> struct abc { char c; float v; }; static void func1(struct abc b) { b.c = 'A'; b.v = 80.7; } static void func2(s 阅读全文
posted @ 2021-10-04 14:38 卷哭你 阅读(94) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> struct i2c_dev { int fd; int addr; }; static struct i2c_dev i2c[3]; static struct i2c_dev* pi2c; int main() { p 阅读全文
posted @ 2021-10-04 11:04 卷哭你 阅读(230) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> #define getnode(type) (type*)malloc(sizeof(type)) struct node { char info; struct node*link; }*top,*p; char c; 阅读全文
posted @ 2021-10-04 11:03 卷哭你 阅读(202) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> typedef struct anode { char info; struct anode*link; }*ptype_node; /* (1)按定义变量的方法写出定义体 (2)把变量名换成新类型名 (3)在最前面加上关 阅读全文
posted @ 2021-10-04 11:01 卷哭你 阅读(59) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> int main() { long frame_size = 0x12345678; union { int a; long b; char c; }m; m.b = 0x12345678; printf("Hello w 阅读全文
posted @ 2021-10-03 21:51 卷哭你 阅读(211) 评论(0) 推荐(0)
摘要:shell -e: -e filename 判断文件是否存在 if [ -e xxx ]; then else echo "xxx" fi if [ -e xxx ]; then echo "xxxx" fi 阅读全文
posted @ 2020-12-12 15:01 卷哭你 阅读(166) 评论(0) 推荐(0)
摘要:挂载:把分区和目录对应的过程 建立映射 挂载点:挂载在文件树中的位置 mount 参数 设备名称 挂载点 -a 安装在/etc/fstab文件中列出的所有文件系统. -l 列出当前已挂载的设备,文件系统名称和挂载点 -o 指定挂载选项, -t 文件系统类型,指定设备的文件系统类型, ext2 Msd 阅读全文
posted @ 2020-10-05 00:02 卷哭你 阅读(944) 评论(0) 推荐(0)
摘要:tar xzvf xxx.tar.gz tar xf xxx.rar 将xz文件解压为tar文件 xz -d xxx.tar.xz tar czvf xxx.tar.gz xxx xxx xx xx xx (c为create意思) 解决flash资源不够用 阅读全文
posted @ 2020-09-04 14:37 卷哭你 阅读(140) 评论(0) 推荐(0)
摘要:(1)追踪一下 shell strace ./strace ./command.sh # ./strace ./command.sh execve("./command.sh", ["./command.sh"], 0x7ff0f82270 /* 13 vars */) = 0 brk(NULL) 阅读全文
posted @ 2020-03-18 14:13 卷哭你 阅读(268) 评论(0) 推荐(0)