help-cfengine
[Top][All Lists]
Advanced

[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 <address@hidden>
> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]