public static boolean isSU(String shell){
  int pos=shell.indexOf(' ');
  if (pos >= 0) {
    shell=shell.substring(0,pos);
  }
  pos=shell.lastIndexOf('/');
  if (pos >= 0) {
    shell=shell.substring(pos + 1);
  }
  return shell.equals("su");
}

public static boolean isSU ( String shell ) { int pos = shell . indexOf ( ' ' ) ; if ( pos >= 0 ) { shell = shell . substring ( 0 , pos ) ; } pos = shell . lastIndexOf ( '/' ) ; if ( pos >= 0 ) { shell = shell . substring ( pos + 1 ) ; } return shell . equals ( "su" ) ; }
attempts to deduce if the shell command refers to a su shell
