a 771 lines diff
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
/*
|
||||
* Hello, Sun.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
3
code/shell/demofonctions.sh
Executable file
3
code/shell/demofonctions.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
. ./fonctions.sh
|
||||
message "hello world"
|
||||
5
code/shell/fonctions.sh
Normal file
5
code/shell/fonctions.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
message ()
|
||||
{
|
||||
echo $1 | boxes
|
||||
}
|
||||
7
code/shell/heredoc.sh
Executable file
7
code/shell/heredoc.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
gnuplot << __EOC__
|
||||
set term dumb
|
||||
set grid
|
||||
plot [x=0:pi*2] sin(x)
|
||||
__EOC__
|
||||
Reference in New Issue
Block a user