Operating System - HP-UX
1823249 Members
3159 Online
109648 Solutions
New Discussion юеВ

Help with next ioscan -F scriptable syntax (with new feature)

 
SOLVED
Go to solution
marie-noelle jeanson_1
Trusted Contributor

Help with next ioscan -F scriptable syntax (with new feature)

Hi,

I have a scripting question. In ioscan, we use -F to display all the fields of an entry in a compacted way. Today, the dsf names are listed in the next lines (with a dsf char and block names on the same line).
I a future release, we will introduce an option to add multiple paths to a LUN to this output.
In terms of scripting usability, is it ok to display this (each entry is on several lines):
< class >:< instance >....< description>
....
< char dsf name1>
< char dsf name2>

Any better suggestion?
Note: We do not want to break backward compatibility of what exists today, so we have to keep the dsf names as they are today.

Thanks,

Marie.
4 REPLIES 4
Bill Hassell
Honored Contributor

Re: Help with next ioscan -F scriptable syntax (with new feature)

The -F option is designed for scripting by placing all the details on one line. Since devicefiles are always listed on the next line, I don't see a problem with multiple lines to handle multiple paths to devices. I am assuming that a new option will be created to display the multiple paths.


Bill Hassell, sysadmin
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Help with next ioscan -F scriptable syntax (with new feature)

As long as the -F format (w/o this addional flag) stays the same I don't see any problem with your proposal; however, once your new option goes into effect resist all other impulses to "improve" the format because that will break scripts. You might consider adding leading pad character(s) to the lun path line to make it easy to decide if this line is the lun line. For example, if the line begins with "#" then it's trivially easy to test in the shell, awk, sed, or Perl.
If it ain't broke, I can fix that.
marie-noelle jeanson_1
Trusted Contributor

Re: Help with next ioscan -F scriptable syntax (with new feature)

Thanks for your replies. We are not changing the output in existing option, this requires a new option to be used. And the reason why we are seeking input now is to avoid to make changes after it is released. If this is a brand new option, then we couls also display a symbol before the list of dsfs, right?
Like:
<........> first line of data
DSF ...
LP ...

Would that work?

Thanks,

Marie.
A. Clay Stephenson
Acclaimed Contributor

Re: Help with next ioscan -F scriptable syntax (with new feature)

Yes, that should work but just make certain that you choose tags that could never be found in the first field of the : ... line

e.g
"#LP#"
rather than simply "LP"
you might also consider separating each LUN and each dsf name group with rather than space -- that too would make scripting safer and easier but above all, the key to good scripting is that the documentation accurately reflect the output in all cases.
If it ain't broke, I can fix that.