Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Languages and Scripting
Showing results for 
Search instead for 
Did you mean: 

ksh: compare of two outputs ( with a array )

Valued Contributor

ksh: compare of two outputs ( with a array )



with informations of  filesystem of a service guard package (style modular)

i will check the actual mounted filesystems with the output of a service guard package command (cmgetconf).

a filesystem can be mounted  but not configured (existing) in a svg package config.

so i  have to compare two outputs. i store those outputs in two arrays .


1.  parse output of svg package and store it in a array

parse the informations of the fs config of a svg package

( i store it in /tmp/cmgetconf.lst , so no svg command is needed )

grep -E "^fs_name|^fs_directory|^fs_type|^fs_mount_opt|^fs_umount_opt|^fs_fsck_opt"  of command.


2. parse output of  bdf and grep of svg package ( the vgname include the svg package name)

    i stored the "bdf" output in /tmp/bdf.lst


3. compare the two arrays and show the filesystems , which i didn't find in output of svg command.


i find no better way ...


kind regards