Uncategorized

An update to the bash script that takes a parameter:

#!/bin/bash book=$1 [[ -z $book ]] && { echo “No argument supplied, exiting!”; exit 1; } [[ ! -e $book ]] && { echo “Can’t find a file with the name $book, exiting”; exit 1; } title=${book%.*} bookcounter=0 linecounter=0 sed -i ‘s/\r$//’ “$book” while read line do ((linecounter+=1)) if [[ $linecounter -gt 300 && -z “$line” || -z “$output_file” ]];…

Continue Reading