Tag: bash

Script: man2ps, man2pdf, man2evince

Usage: $ man2ps command will generate a PostScript (.ps) file from command's manpage Symlink or copy this script as "man2pdf" to create a PDF from a manpage. Symlink or copy this script as "man2evince" to call evince on a temporary PDF of the manpage #!/bin/bash # man2ps, (c) 2004,2005,2006,2009 Toni Corvera, published under a BSD […]

Read More

Script: video identification (Bash)

This script displays mplayer's information/identification lines of a multimedia file. Nowadays I prefer to use an undocumented feature of vcs (see below) #!/bin/bash # This script displays mplayer's information/identification lines of a multimedia file # Put in the public domain. <http://w.corvera.eu/2007/11/shell-vidid/> vididf() { mplayer -identify -frames 0 -ao null -vo null "$1" 2>/dev/null | grep […]

Read More

Valor de retorno en el prompt

Este código sirve para indicar si el último comando ha tenido éxito o no, de manera que siempre esté visible en el propio prompt, es ideal para depurar código entre otras cosas. Versión rápida (aunque no muy legible :P): export PS1='$( [ "$?" -eq 0 ] && M=")" || M="("; echo -n :$M ) '$PS1 […]

Read More