Empty string handling in EMC Smarts dmctl

The "dmctl" utility has a few limitations in the way it handles it's arguments, particularly when called from the Unix or Linux shell.

One that I used to hit frequently was that it wasn't apparently possible to set a string attribute to an empty value. The following fails, although you'd expect it to work...

dmctl -s DOMAIN put Host::myserver::DisplayName ""

The problem seems to be that dmctl doesn't 'see' the empty string and complains that there are not enough being passed.

Here's the solution that I have recently discovered..

dmctl -s DOMAIN put Host::myserver::DisplayName '""'

The final part of the command line is a pair of double quotes surrounded by single quotes. Normally, I'd expect that to set the attribute to a string consisting of 2 double quotes - but it doesn't  And the reason is that dmctl itself seems to have some quote handling logic built in. The single quotes arrange that the double quotes are passed to dmctl. Dmctl sees the double-quotes as denoting an empty string and does what we want.

So that fixes that specific problem  - but introduces an number of others in the process. In particular -- how do you pass a string which contains quotes? Maybe more on that later.

Scroll to Top