[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Switching off a shellcommand with empty list variable
From: |
Jeremy Mates |
Subject: |
Re: Switching off a shellcommand with empty list variable |
Date: |
Fri, 21 Jan 2005 10:23:35 -0800 |
User-agent: |
Mutt/1.4.1i |
* David Baird <dave@riverside-cms.co.uk>
> The perl one-liner returns a colon-separated list of ports that need
> to be installed. The problem is that if there are no missing ports,
> the shellcommand still gets called. Is there any way I can set a class
> if $(missing_ports) is empty?
Perhaps wrap portupgrade and abort if the arguments list is empty?
"/usr/local/sbin/wrap-portupgrade $(missing_ports)"
#!/bin/sh
[ -z "$1" ] && exit
exec /usr/local/sbin/portupgrade $@
--
Jeremy Mates (206) 22 1-4714
Systems Administrator K 324, Health Sciences Center
http://cfm.gs.washington.edu/ Mail Box 357730