30 lines
320 B
Bash
30 lines
320 B
Bash
|
|
#!/bin/sh
|
||
|
|
|
||
|
|
if [ $# -eq 0 ]; then
|
||
|
|
echo "Missing argument"
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Dir
|
||
|
|
mkdir $1
|
||
|
|
cd $1
|
||
|
|
|
||
|
|
#Header
|
||
|
|
header="${1^^}_H"
|
||
|
|
echo -e "#ifndef ${header}\n#define ${header}\n\n#endif // ${header}" >> $1.h
|
||
|
|
|
||
|
|
# Source
|
||
|
|
echo -e "#include <stdio.h>
|
||
|
|
|
||
|
|
#include \"$1.h\"
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
int main(void)
|
||
|
|
{
|
||
|
|
printf(\"%\", );
|
||
|
|
puts();
|
||
|
|
}
|
||
|
|
" >> $1.c
|
||
|
|
|
||
|
|
cd ..
|