a 771 lines diff

This commit is contained in:
tTh
2023-10-08 21:56:41 +02:00
parent c6fe2224bf
commit c3e227f472
23 changed files with 339 additions and 42 deletions

View File

@@ -1,5 +1,7 @@
/*
* demo strtok
* +-------------+
* | demo strtok |
* +-------------+
*/
#include <stdio.h>
@@ -14,7 +16,8 @@ unsigned char *ptr;
printf(" --- %s\n", titre);
ptr = (unsigned char *)ligne;
for (foo=0; foo<combien; foo++) {
printf("%02x ", ptr[foo]);
if (ptr[foo]) printf("%02x ", ptr[foo]);
else printf("\\0 ");
}
puts("");
for (foo=0; foo<combien; foo++) {
@@ -49,6 +52,6 @@ dump_line("2eme & 3me strtok", copie, sizeof(input));
foo = cptr - copie; /* this is the hack :) */
printf(" index = %d\n", foo);
printf(" and we have [%s]\n", input+foo);
printf(" and we have [%s] :)\n", input+foo);
return 0;
}

View File

@@ -1,7 +1,3 @@
/*
* Hello, Sun.
*/
#include <stdio.h>
int main(int argc, char *argv[])

3
code/shell/demofonctions.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
. ./fonctions.sh
message "hello world"

5
code/shell/fonctions.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
message ()
{
echo $1 | boxes
}

7
code/shell/heredoc.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
gnuplot << __EOC__
set term dumb
set grid
plot [x=0:pi*2] sin(x)
__EOC__