File INSTALL changed (mode: 100755) (index b83c078..b9f5cac) |
... |
... |
if [ "$1" = "" ]; then |
10 |
10 |
$CC exho.c -o exho |
$CC exho.c -o exho |
11 |
11 |
./exho "$CC clp.c -o clp" |
./exho "$CC clp.c -o clp" |
12 |
12 |
./exho "$CC echo.c -o echo" |
./exho "$CC echo.c -o echo" |
13 |
|
./exho "$CC ins.c -o ins" |
|
14 |
13 |
./exho "lex nl.l && $CC lex.yy.c -o nl -lfl && rm lex.yy.c" |
./exho "lex nl.l && $CC lex.yy.c -o nl -lfl && rm lex.yy.c" |
15 |
14 |
./exho "$CC sc.c -o sc" |
./exho "$CC sc.c -o sc" |
16 |
15 |
./exho "$CC spng.c -o spng" |
./exho "$CC spng.c -o spng" |
|
... |
... |
if [ "$1" = "" ]; then |
18 |
17 |
./exho "$CC wc.c -o wc" |
./exho "$CC wc.c -o wc" |
19 |
18 |
./exho "$CC yes.c -o yes" |
./exho "$CC yes.c -o yes" |
20 |
19 |
fi |
fi |
21 |
|
[ "$1" = "clean" ] && rm clp echo exho ins nl sc spng tee wc yes |
|
|
20 |
|
[ "$1" = "clean" ] && rm clp echo exho nl sc spng tee wc yes |
File README changed (mode: 100644) (index b38b363..7e7dee0) |
... |
... |
manager for standard input and output. |
14 |
14 |
|
|
15 |
15 |
clp: |
clp: |
16 |
16 |
Insert by piping in standard input ex. |
Insert by piping in standard input ex. |
17 |
|
echo lmao | clp i |
|
|
17 |
|
echo test | clp i |
18 |
18 |
that uses its "i" option. This will copy the stdin |
that uses its "i" option. This will copy the stdin |
19 |
19 |
into your ~/.clipboard file as an entry. |
into your ~/.clipboard file as an entry. |
20 |
20 |
the -f option will set your clipboard file to be |
the -f option will set your clipboard file to be |
21 |
|
whatever you want for that command: echo lmao | clip -f altclipboard i |
|
|
21 |
|
whatever you want for that command: echo test | clip -f altclipboard i |
22 |
22 |
the following commands use ed-like addressing. |
the following commands use ed-like addressing. |
23 |
23 |
clp ,p will print (paste) your entire clipboard, |
clp ,p will print (paste) your entire clipboard, |
24 |
24 |
clp 1,2p will print the earliest 2 entries, |
clp 1,2p will print the earliest 2 entries, |
25 |
25 |
and clp p will print the latest entry. |
and clp p will print the latest entry. |
26 |
|
the same works with the "d" option, except |
|
27 |
|
it deletes the entries. |
|
|
26 |
|
the same works with the "d" option, which deletes. |
28 |
27 |
clp c just counts the entries and ends the program. |
clp c just counts the entries and ends the program. |
29 |
28 |
i: insert |
i: insert |
30 |
29 |
p: print |
p: print |
|
... |
... |
the versions already in your /usr/bin or /bin, |
53 |
52 |
for any issues and changes you would like to see, |
for any issues and changes you would like to see, |
54 |
53 |
email me at sl@airmail.cc |
email me at sl@airmail.cc |
55 |
54 |
|
|
|
55 |
|
Copyright 2020 Matthew Graham <sl@airmail.cc> |
56 |
56 |
These programs are under the GPLv3 or any later version. |
These programs are under the GPLv3 or any later version. |
|
57 |
|
A copy of the GPL is available in the COPYING file. |
File clp.c changed (mode: 100644) (index 10d3ad5..e26e8ee) |
... |
... |
int main(int argc, char *argv[]) |
56 |
56 |
break; |
break; |
57 |
57 |
case 'p': outflag = 1; |
case 'p': outflag = 1; |
58 |
58 |
break; |
break; |
59 |
|
case 'd': delflag = 1;; |
|
|
59 |
|
case 'd': delflag = 1; |
60 |
60 |
break; |
break; |
61 |
61 |
case 'c': ocountflag = 1; |
case 'c': ocountflag = 1; |
62 |
62 |
break; |
break; |
|
... |
... |
int main(int argc, char *argv[]) |
99 |
99 |
fprintf(filep, "%s%s", delim, inbuf); |
fprintf(filep, "%s%s", delim, inbuf); |
100 |
100 |
goto ending; |
goto ending; |
101 |
101 |
} |
} |
102 |
|
|
|
|
102 |
|
rewind(filep); //so it can start at the beginning |
103 |
103 |
while (fgets(tester, sizeof(tester), filep)!=NULL) |
while (fgets(tester, sizeof(tester), filep)!=NULL) |
104 |
104 |
if (memcmp(tester, delim, sizeof(delim)-1)==0) |
if (memcmp(tester, delim, sizeof(delim)-1)==0) |
105 |
105 |
end++; |
end++; |
File echo.c changed (mode: 100644) (index 3f3c327..59c4523) |
... |
... |
int main(int argc, char *argv[]) |
24 |
24 |
printf("%s%c", argv[i], i==argc? '\n':' '); |
printf("%s%c", argv[i], i==argc? '\n':' '); |
25 |
25 |
return 0; |
return 0; |
26 |
26 |
} |
} |
27 |
|
) |
|
28 |
|
if (memcmp(tester, delim, sizeof(delim)-1)==0) |
|
29 |
|
end++; |
|
30 |
|
rewind(filep); |
|
31 |
|
|
|
32 |
|
if (ocountflag) { |
|
33 |
|
printf("%ld\n", end); |
|
34 |
|
goto ending; /* stops program after outputting count */ |
|
35 |
|
} |
|
36 |
|
|
|
37 |
|
if (end==0) { |
|
38 |
|
fputs("nothing to act on\n", stderr); |
|
39 |
|
fclose(filep); |
|
40 |
|
exit(1); |
|
41 |
|
} |
|
42 |
|
if (to>end) { |
|
43 |
|
fputs("clip: end point too big\n", stderr); |
|
44 |
|
fclose(filep); |
|
45 |
|
exit(1); |
|
46 |
|
} |
|
47 |
|
if (!from && !to && commaflag) { from=1; to=end; } |
|
48 |
|
if (!from && !to && !commaflag) { from = end; to = end; } |
|
49 |
|
if (from && !to && commaflag) to = end; |
|
50 |
|
if (delflag) { |
|
51 |
|
int delimflag=0; |
|
52 |
|
if ((tdelfilep=fopen(".clipboard~~~", "w+"))==NULL) { |
|
53 |
|
fputs("clip: cannot create temporary file\n", stderr); |
|
54 |
|
fclose(filep); |
|
55 |
|
exit(1); |
|
56 |
|
} |
|
57 |
|
while (counter <= end && fgets(tester, sizeof(tester), filep)) { |
|
58 |
|
if (memcmp(tester, delim, sizeof(delim)-1)==0) { |
|
59 |
|
counter++; |
|
60 |
|
delimflag=1; |
|
61 |
|
continue; |
|
62 |
|
} |
|
63 |
|
if (counter < from || counter > to) { |
|
64 |
|
fprintf(tdelfilep, "%s%s", delimflag?delim:"", tester); |
|
65 |
|
delimflag=0; |
|
66 |
|
} |
|
67 |
|
} |
|
68 |
|
rename(".clipboard~~~", filename); |
|
69 |
|
goto ending; |
|
70 |
|
} |
|
71 |
|
|
|
72 |
|
if (outflag) { |
|
73 |
|
while (counter <= end && fgets(tester, sizeof(tester), filep)) { |
|
74 |
|
if (memcmp(tester, delim, sizeof(delim)-1)==0) { |
|
75 |
|
counter++; |
|
76 |
|
continue; |
|
77 |
|
} |
|
78 |
|
if (counter >= from && counter <= to) { |
|
79 |
|
fputs(tester, stdout); |
|
80 |
|
} |
|
81 |
|
} |
|
82 |
|
} |
|
83 |
|
ending: |
|
84 |
|
fclose(filep); |
|
85 |
|
exit(0); |
|
86 |
|
} |
|
File yes.c changed (mode: 100644) (index e69de29..962e0d9) |
|
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 |
|
|
|
20 |
|
void main(int argc, char *argv[]) |
|
21 |
|
{ |
|
22 |
|
pledge("stdio", 0); |
|
23 |
|
if (argc==1) |
|
24 |
|
for(;;) |
|
25 |
|
puts("y"); |
|
26 |
|
else |
|
27 |
|
for (;;) |
|
28 |
|
puts(argv[1]); |
|
29 |
|
} |