Advertisement
maurol22

man2pdf.sh

Apr 28th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.27 KB | None | 0 0
  1. #!/bin/bash
  2. if [ $# == 2 ]; then
  3.     man -t $1 $2 > $2.ps && ps2pdf $2.ps $2.pdf && rm $2.ps && echo "$2.pdf created"
  4. elif [ $# == 1 ]; then     
  5.     man -t $1 > $1.ps && ps2pdf $1.ps $1.pdf && rm $1.ps && echo "$1.pdf created"
  6. else
  7.     echo "Error: insert a command to convert"
  8. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement