I am trying to create a nice Alias for the `zfs list` command.
This is all happening on a "SunOS 5.11 11.1 i86pc i386 i86pc Solaris" not convinced it will be portable not to start with any way!
These are various workings and versions.
Custom Fields[edit]
First version with some custom chosen fields
alias zlist='zfs list -o name,used,refer,usedbydataset,usedbysnapshots,avail,compressratio,mountpoint'
Custom Fields Sorted[edit]
The same as above but sorted by space used
alias zlists='zfs list -o name,used,refer,usedbydataset,usedbysnapshots,avail,compressratio,mountpoint | /usr/gnu/bin/sort -rhk2'
Custom Fields Sorted and Filtered[edit]
I have several old BE's (Boot Environments) I don't want to delete them but I also don't want them shown every time I do a list
alias zlist="zfs list -o name,used,refer,usedbydataset,usedbysnapshots,avail,compressratio,mountpoint |/usr/gnu/bin/egrep -v \ \"$(beadm list -H | awk -F$';' ' out != "" && $3 != "N" && $3 != "R" { out=out "[[:space:]]|" $1 } ; out == "" && $3 != "N" && $3 != "R" { out=$1 } ; END { print out } ')\" "
This is not how I want it yet! far from it!
- the sub command for beadmin list is run when the alias is created
- I would like the BE's that are displayed to have there status listed next to them (N = Active now, R = Active on reboot)
- This is probably best all done in awk instead of using grep (OK its probably best in some "real" programming language like perl but I wanted to do it in shell so narrrrr)