[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] condor_status with -format options

Kewley, J (John) wrote:
> > One of the features of condor_status is that if a field name 
> > is not valid then nothing is printed for that field, with the 
> > additional feature that if there is no "%" conversion in the 
> > format string then the format string is printed regardless of 
> > the field name.  So you can ensure there is always a trailing 
> > carriage return like this:
> > 
> > /opt/condor/bin/condor_status -format "%s " Name -format "%s" 
> > RemoteUser -format "\n" AnyString
> > 
> > 
> > This is useful since RemoteUser may or may not be defined 
> > depending on the machine state.
> It used to be the case that AnyString had to match a proper ClassAd
> value
> Otherwise nothing was printed. If this has changed then it is likely to
> be in 6.9 only.

It has been this way since 6.6.8, I just checked the release notes.

In fact, this is the example they give:

For example, to print out the machine's Name (always defined) and the
RemoteUser (only defined if the machine is claimed), and always print a
newline (to keep the formatting legible), this command will now work:

% condor_status -f "%s " Name -f "%s " RemoteUser -f "\n" bogus

Daniel K. Forrest	Laboratory for Molecular and
forrest@xxxxxxxxxxxxx	Computational Genomics
(608) 262 - 9479	University of Wisconsin, Madison