2021-08-03 04:40:29 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int main(int argc, char ** argv) {
|
|
|
|
if(argc == 1) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int i = 1;
|
2021-08-03 04:41:16 +00:00
|
|
|
FILE * log = fopen("/var/log/messages", "a+");
|
2021-08-03 04:40:29 +00:00
|
|
|
if(log == NULL) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf(log, "\n");
|
|
|
|
for(i = 1; i < argc - 1; i++) {
|
|
|
|
fprintf(log, "%s ", argv[i]);
|
|
|
|
}
|
|
|
|
fprintf(log, "%s", argv[i]);
|
|
|
|
|
|
|
|
fclose(log);
|
|
|
|
return 0;
|
|
|
|
}
|