Moved scripts to paren folder, and updated README some more

This commit is contained in:
Techognito 2025-08-14 22:45:04 +02:00
parent e45fb41e1b
commit b4891f3061
6 changed files with 7 additions and 1 deletions

65
greatSplitter.sh Executable file
View file

@ -0,0 +1,65 @@
#!/bin/bash
outfile=""
infile="restofgreatbook.txt"
tempfile="restofgreatbook.txt.copy"
split(){
outfile=$(head -n 1 $infile).txt
headline=$1
tailline=$(($1+1))
if [[ $1 != "" ]]; then
echo $headline
echo $tailline
clear
head -n $headline $infile
echo " "
# echo " "
echo "Lines count (102 for 100 items, 52 for 50 items): "$headline
yn=y
read -p "Continue with this list? [Y/n]" yn
case $yn in
[Yy]*)
head -n $headline $infile > "$outfile"
cp $infile $tempfile
tail -n +$tailline $tempfile > $infile
;;
[Nn]*)
echo "split aborted"
exit
;;
esac
else
echo "missing number"
echo "use 'greatSplitter.sh count | head' to get the next line number "
exit 1
fi
# echo "hello test"
# echo $headline
# echo $tailline
echo $outfile
echo $1
}
linecount(){
let count=0
while read line; do
let count=$count+1
if [ "$line" = "" ]; then
echo $count
echo $line
fi
done < $infile
}
case $1 in
count)
linecount | head -n 1
;;
split)
split $(linecount | head -n 1)
;;
esac