#!/usr/bin/env bash
file=linux-intro
folders="\
00.installation \
01.introduktion \
02.lager \
03.regexp \
04.stil \
05.avsl \
"
# Include example text file to each lesson
text=text.txt
for f in $folders; do
mkdir -p $file/$f
for i in `seq 0 4`; do
tail -n +$(( 10 * $i )) $text | head -n10 \
> $file/$f/$(printf "file-%.2d.txt" $i)
done
done
# Include script examples to lesson 4
cp prime.sh prime.c $file/04.stil
# Compress and cleanup
tar -cvf $file.tar $file
rm -fr $file
Last modified | History | Source | Preferences