File INSTALL changed (mode: 100755) (index b9f5cac..46ffe64) |
6 |
6 |
# getting it from your distro repositories |
# getting it from your distro repositories |
7 |
7 |
CC="clang" |
CC="clang" |
8 |
8 |
if [ "$1" = "" ]; then |
if [ "$1" = "" ]; then |
9 |
|
echo "$CC exho.c -o exho" |
|
10 |
|
$CC exho.c -o exho |
|
11 |
|
./exho "$CC clp.c -o clp" |
|
12 |
|
./exho "$CC echo.c -o echo" |
|
13 |
|
./exho "lex nl.l && $CC lex.yy.c -o nl -lfl && rm lex.yy.c" |
|
14 |
|
./exho "$CC sc.c -o sc" |
|
15 |
|
./exho "$CC spng.c -o spng" |
|
16 |
|
./exho "$CC tee.c -o tee" |
|
17 |
|
./exho "$CC wc.c -o wc" |
|
18 |
|
./exho "$CC yes.c -o yes" |
|
|
9 |
|
./exho ./c mk clp.c |
|
10 |
|
./exho ./c mk echo.c |
|
11 |
|
./exho "lex nl.l && $CC lex.yy.c -o nl -lfl" |
|
12 |
|
./exho ./c mk sc.c |
|
13 |
|
./exho ./c mk spng.c |
|
14 |
|
./exho ./c mk tee.c |
|
15 |
|
./exho ./c mk wc.c |
|
16 |
|
./exho ./c mk yes.c |
19 |
17 |
fi |
fi |
20 |
|
[ "$1" = "clean" ] && rm clp echo exho nl sc spng tee wc yes |
|
|
18 |
|
[ "$1" = "clean" ] && rm clp echo clp nl sc spng tee wc yes |
File exho added (mode: 100755) (index 0000000..a6ca102) |
|
1 |
|
# Copyright (c) 2019 Matthew Graham |
|
2 |
|
# |
|
3 |
|
# This program is free software: you can redistribute it and/or modify |
|
4 |
|
# it under the terms of the GNU General Public License as published by |
|
5 |
|
# the Free Software Foundation, either version 3 of the License, or |
|
6 |
|
# (at your option) any later version. |
|
7 |
|
# |
|
8 |
|
# This program is distributed in the hope that it will be useful, |
|
9 |
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 |
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 |
|
# GNU General Public License for more details. |
|
12 |
|
# |
|
13 |
|
# You should have received a copy of the GNU General Public License |
|
14 |
|
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
15 |
|
|
|
16 |
|
"$@" && echo "$@" |
File exho.c deleted (index 35eac8c..0000000) |
1 |
|
/* |
|
2 |
|
Copyright (c) 2019 Matthew Graham |
|
3 |
|
|
|
4 |
|
This program is free software: you can redistribute it and/or modify |
|
5 |
|
it under the terms of the GNU General Public License as published by |
|
6 |
|
the Free Software Foundation, either version 3 of the License, or |
|
7 |
|
(at your option) any later version. |
|
8 |
|
|
|
9 |
|
This program is distributed in the hope that it will be useful, |
|
10 |
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
|
GNU General Public License for more details. |
|
13 |
|
|
|
14 |
|
You should have received a copy of the GNU General Public License |
|
15 |
|
along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
16 |
|
*/ |
|
17 |
|
|
|
18 |
|
#include <stdio.h> |
|
19 |
|
#include <stdlib.h> |
|
20 |
|
|
|
21 |
|
int main(int argc, char *argv[]) |
|
22 |
|
{ |
|
23 |
|
if (argc>1) { |
|
24 |
|
printf("%s\n", argv[1]); |
|
25 |
|
system(argv[1]); |
|
26 |
|
} |
|
27 |
|
return 0; |
|
28 |
|
} |
|
File ins changed (mode: 100755) (index 81a9e92..5a9e33d) |
|
1 |
|
# Copyright (c) 2019 Matthew Graham |
|
2 |
|
# |
|
3 |
|
# This program is free software: you can redistribute it and/or modify |
|
4 |
|
# it under the terms of the GNU General Public License as published by |
|
5 |
|
# the Free Software Foundation, either version 3 of the License, or |
|
6 |
|
# (at your option) any later version. |
|
7 |
|
# |
|
8 |
|
# This program is distributed in the hope that it will be useful, |
|
9 |
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 |
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 |
|
# GNU General Public License for more details. |
|
12 |
|
# |
|
13 |
|
# You should have received a copy of the GNU General Public License |
|
14 |
|
# along with this program. If not, see <https://www.gnu.org/licenses/> |
|
15 |
|
|
1 |
16 |
#!/bin/sh |
#!/bin/sh |
2 |
17 |
cat - > ".temp~~" |
cat - > ".temp~~" |
3 |
18 |
for file in "$@"; do |
for file in "$@"; do |
4 |
|
cat ".temp~~" "$file" | spng "$file" |
|
|
19 |
|
cat ".temp~~" "$file" | ./spng "$file" |
5 |
20 |
done |
done |
6 |
21 |
rm ".temp~~" |
rm ".temp~~" |
File wc.c changed (mode: 100644) (index f3b9072..7c05702) |
... |
... |
void wcout(char *wd, int lines, int words, int bytes, char name[]) |
36 |
36 |
int main(int argc, char *argv[]) |
int main(int argc, char *argv[]) |
37 |
37 |
{ |
{ |
38 |
38 |
int character; |
int character; |
39 |
|
int linec=0, wordc=0, bytec=0, iter = 1; |
|
|
39 |
|
int linec=0, wordc=0, bytec=0, i = 1; |
40 |
40 |
int tlinec=0, twordc=0, tbytec=0; |
int tlinec=0, twordc=0, tbytec=0; |
41 |
41 |
unsigned int spaceflag, lineflag, tabflag; |
unsigned int spaceflag, lineflag, tabflag; |
42 |
42 |
char *wd = "lwc"; |
char *wd = "lwc"; |
|
... |
... |
int main(int argc, char *argv[]) |
50 |
50 |
|
|
51 |
51 |
do { |
do { |
52 |
52 |
lineflag=1; |
lineflag=1; |
53 |
|
if (argc > 1 && (filep = fopen(argv[iter], "r"))==NULL) { |
|
54 |
|
fprintf(stderr, "wc: unable to open %s\n", argv[iter]); |
|
|
53 |
|
if (argc > 1 && (filep = fopen(argv[i], "r"))==NULL) { |
|
54 |
|
fprintf(stderr, "wc: unable to open %s\n", argv[i]); |
55 |
55 |
continue; |
continue; |
56 |
56 |
} |
} |
57 |
57 |
while ((character = fgetc(filep)) != EOF) { |
while ((character = fgetc(filep)) != EOF) { |
|
... |
... |
int main(int argc, char *argv[]) |
79 |
79 |
tbytec += bytec; |
tbytec += bytec; |
80 |
80 |
} |
} |
81 |
81 |
if (argc > 1) |
if (argc > 1) |
82 |
|
wcout(wd, linec, wordc, bytec, argv[iter]); |
|
|
82 |
|
wcout(wd, linec, wordc, bytec, argv[i]); |
83 |
83 |
else |
else |
84 |
84 |
wcout(wd, linec, wordc, bytec, ""); |
wcout(wd, linec, wordc, bytec, ""); |
85 |
85 |
|
|
86 |
86 |
linec = 0; |
linec = 0; |
87 |
87 |
wordc = 0; |
wordc = 0; |
88 |
88 |
bytec = 0; |
bytec = 0; |
89 |
|
} while (++iter<argc); |
|
|
89 |
|
} while (++i<argc); |
90 |
90 |
if (argc > 2) |
if (argc > 2) |
91 |
91 |
wcout(wd, tlinec, twordc, tbytec, "total"); |
wcout(wd, tlinec, twordc, tbytec, "total"); |
92 |
92 |
} |
} |