Skip to content

Instantly share code, notes, and snippets.

View seppo0010's full-sized avatar

Sebastian Waisbrot seppo0010

  • Buenos Aires, Argentina
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
set -Eeux
f=493393291-Borda-Manual-de-Contratos-2020.pdf
prev_page=0
prev_title=""
while read line; do
this_page=$(echo $line | awk '-F:' '{print $1}')
this_title=$(echo $line | awk '-F:' '{print $2}' |xargs)
target="${f/.pdf/} - $prev_title.pdf"
if [ "$prev_page" -gt 0 ] && [ ! -f "$target" ]; then