add cecho
This commit is contained in:
parent
cc6b926983
commit
ce8e5356a6
2 changed files with 15 additions and 1 deletions
|
@ -9,4 +9,4 @@ All code is licensed under GPL-3.0 unless specified otherwise.
|
||||||
| C | Bash | JS |
|
| C | Bash | JS |
|
||||||
| ---------------------- | :-------------------------: | --- |
|
| ---------------------- | :-------------------------: | --- |
|
||||||
| [unlink.c](c/unlink.c) | [arshit](shell/bash/arshit) | |
|
| [unlink.c](c/unlink.c) | [arshit](shell/bash/arshit) | |
|
||||||
| | | |
|
| [cecho.c](c/cecho.c) | | |
|
||||||
|
|
14
c/cecho.c
Normal file
14
c/cecho.c
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
for (int i = 1; i < argc; i++) {
|
||||||
|
printf("\033[%dm%s", i % 2, argv[i]);
|
||||||
|
if (i != argc - 1)
|
||||||
|
putchar(' ');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compilation: cc unlink.c -o unlink
|
||||||
|
// Usage: ./unlink FILES ...
|
||||||
|
// License: Public Domain
|
Loading…
Reference in a new issue