Skip to content

Instantly share code, notes, and snippets.

@nathanielanozie
Created October 14, 2014 11:36
Show Gist options
  • Save nathanielanozie/7b0e567cb9dfd583a27b to your computer and use it in GitHub Desktop.
Save nathanielanozie/7b0e567cb9dfd583a27b to your computer and use it in GitHub Desktop.
select all cluster in all selected roots
//select all cluster in all selected roots
//Author: Nathaniel Anozie (ogbonnawork at gmail dot com)
//nathananozie dot blogspot dot com
global proc na_selectClusterOfHierarchy(){
string $result[] = {};
string $sel[] = `ls -sl`;
for($arg in $sel){
string $past[] = {};
$past =`listConnections $arg`;
string $hist[] = `ls -type cluster $past`;//cluster history
if(size($hist) == 1){ $result = stringArrayCatenate($result, $hist);//save it
}else{}
}//end loop
$result = stringArrayRemoveDuplicates($result);
select -r $result;
}
na_selectClusterOfHierarchy();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment