#!/bin/bash 

[[ -z "$1" ]] || [[ "$1" = -h ]] && {  echo "Use: ${0##*/} book_path"; exit 1; }

! [[ -d $(dirname "${1}") ]] && { notify-send --icon="libro" "No encuentro: $(basename "$(dirname "${1}")")"; echo "No encuentro libro ${1}"; exit 2; }

[ -f "${1}" ] && [ -x "${1}" ]  || { echo "${1} no es ejectuable..."; exit 3 ;}

cd "$(dirname "${1}")" && "./$(basename "${1}")"
