1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00
dotfiles/private_dot_local/bin/executable_viewDotfile

19 lines
414 B
Plaintext
Raw Normal View History

#!/bin/bash
# Check if parameter is passed
if [ ! $# -eq 1 ]; then
echo "Error: no parameter passed!"
exit 1
else
# Check if a valid dot file is passed
if [[ $1 = /tmp/graph*.dot ]]; then
# Check that file exists
if [[ -f $1 ]]; then
dot -T pdf <"$1" | zathura - && rm "$1"
else
echo "File $1 doesn't exist!"
exit 1
fi
fi
fi