Add touch

This commit is contained in:
g1n 2021-08-27 17:34:19 +03:00
parent 0c5f04cf56
commit 147b52eed9
3 changed files with 11 additions and 1 deletions

1
src/.gitignore vendored
View File

@ -1,5 +1,6 @@
*
!.gitignore
!cat.c
!touch.c
!yes.c
!Makefile

View File

@ -2,10 +2,11 @@ CC = gcc
CFLAGS= -Wall -Wextra
LFLAGS=
all: cat yes
all: cat touch yes
main: $(OBJFILES)
$(CC) cat.c -o cat
$(CC) touch.c -o touch
$(CC) yes.c -o yes
test: main

8
src/touch.c Normal file
View File

@ -0,0 +1,8 @@
#include <stdio.h>
int main(int argc, char *argv[]){
for (int i = 1; i < argc; i++) {
FILE *file = fopen(argv[i], "w");
fclose(file);
}
}