Skip to content

Instantly share code, notes, and snippets.

@andykais
Created October 2, 2015 16:29
Show Gist options
  • Save andykais/6e7eec9c835c8cbf46ef to your computer and use it in GitHub Desktop.
Save andykais/6e7eec9c835c8cbf46ef to your computer and use it in GitHub Desktop.
save images as rar file, then rename as .cbr
#!/bin/bash
comicdir=$1
if [ -d "$comicdir" ]
then
outname=$(echo $comicdir | sed -e 's/\///')
outname=$(echo $outname | sed -e 's/\ /_/g')
rarname=$outname'.rar'
cbrname=$outname'.cbr'
rar a "$rarname" "$comicdir"
mv $rarname $cbrname
echo $outname comic file is created
else
echo 'not a directory!'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment