root / user_dict.c @ 0:3c15de202295
History | View | Annotate | Download (583 Bytes)
1 | 0:3c15de202295 | ee11d037 | #include <stdio.h> |
---|---|---|---|
2 | |||
3 | int update_user_dictionary (char *log_dir) |
||
4 | { |
||
5 | char command[300]; |
||
6 | |||
7 | strcpy(command , "cat ");
|
||
8 | strcat(command , log_dir); |
||
9 | strcat(command , "/logs/* | sort | uniq > ref1.txt");
|
||
10 | system(command); |
||
11 | |||
12 | strcpy(command , "cat ref1.txt ");
|
||
13 | strcat(command , log_dir); |
||
14 | strcat(command , "/logs/dict.txt | sort | uniq -u > ref2.txt");
|
||
15 | system(command); |
||
16 | |||
17 | strcpy(command , "cat ref2.txt >> ");
|
||
18 | strcat(command , log_dir); |
||
19 | strcat(command , "/logs/dict.txt ");
|
||
20 | system(command); |
||
21 | |||
22 | system("rm -f ref1.txt");
|
||
23 | system("rm -f ref2.txt");
|
||
24 | return 0; |
||
25 | } |
||
26 | |||
27 |