Bug#289732: Conditional command execution

2005-01-18 Thread Thomas Hood
> So I guess you need to do this: Actually, the snippet I gave can be simplified since "test -x" simply returns false if it is given an empty string as argument. #!/bin/bash ... if CMD="$(command -v update-menus 2>/dev/null)" && [ -x "$CMD" ] ; then update-menus fi --

Bug#289732: Conditional command execution

2005-01-18 Thread Thomas Hood
(cc:ed to #218530) Guilherme de S. Pastore wrote to #289732: > The attached patches make your maintainer scripts behave just like a > package using debhelper would The patch makes use of "which". The problem with "which" is supposed to be that it is in /usr/bin/ and (as Ian Jackson wrote in #21