That's just a question of formatting the output. On Unix/Linux you could use sed/awk/tr/grep/etc. to get to the tabular form. For Windows I don't know there is a native tool but you can always find a Unix port on the net.
E.g.:
It worked for me on a Linux server, with bash shell. So if you are not using bash as the default shell, please run a bash command and try to run it again.
If it doesn't help, try to debug the complex command, by running it partially. E.g.:
start with: echo print NSR client | nsradmin -s servername
and check if you see anything. If the output is OK, add the next command to the end, like: echo print NSR client | nsradmin -s servername | grep "name:\|retention policy:\|group:\|save set:"
And so on. let me know where you loose the output...
This is because your query gives a different output compared to if you run the nsradmin command without the -i query option. So filtering has to be changed
So try this:
nsradmin -i query | sed '/^$/ d' | sed 's/ *retention policy: //g' | sed 's/ *group: //g' | sed 's/ *save set: //g' | tr \\n \\t | sed 's/ *name: //' | sed 's/ *name: /\n/g' | sed 's/;//g' | sed 's/\t\\//g' | sed 's/\t\t/\t/g'
Anyways, please take the sed command out which is after tr (sed 's/ *name: //'), don\t change anythign which is behind that sed, and rerun the script.
If nothing shows up again, please show me the output of:
nsradmin -i query | sed '/^$/ d' | sed 's/ *retention policy: //g' | sed 's/ *group: //g' | sed 's/ *save set: //g' | tr \\n \\t
Until the tr command the output looks perfect. I have no clue why the next sed is not working right for you.
I ran the script on a RedHat Enterprise Linux 4 and it is working fine. sed should give the same results for all Unix/Linux (at least for these simple transformations), but maybe the compatibility is not 100%. So I suggest to run the commands on a Linux client if you can. I have no other ideas.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.