Originally Posted by
jpkotta
You sure about that? Aliases don't take arguments. It will work, but only because -ncycles is the last option and $1 is unbound. What aliases do is a strict substitution of whatever the alias is. There isn't any shell expansion.
Sorry but I don't buy that. I use the following alias (bash) and it works as intended:
Code:
man2pdf() {
if [ -z $1 ]; then
echo "USAGE: man2pdf [manpage]"
else
if [ `find /usr/share/man -name $1\* | wc -l` -gt 0 ]; then
out=/tmp/$1.pdf
if [ ! -e $out ]; then
man -t $1 | ps2pdf - > $out
fi
if [ -e $out ]; then
/usr/bin/evince $out
fi
else
echo "ERROR: manpage \"$1\" not found."
fi
fi
}
Omitting an argument prints the usage message. Maybe I'm misunderstanding your explanation.
Bookmarks