code: private static String readShellFromPasswdFile( String[] args )
      {
          Process process = null;
          BufferedReader reader = null;
          try
          {
              process = startProcess( args );
              reader = createReader( process );
              processPasswdFile( reader );
              process.waitFor();
              reader.close();
          }
          catch( InterruptedException t )
          {
              throw new EnvironmentException( t );
          }
          catch( IOException t )
          {
              throw new EnvironmentException( t );
          }
          finally
          {
              if( process != null )
              {
                  process.destroy();
              }
              close( reader );
          }
          String message = "User " + USERNAME + " is not present in the passwd database";
          throw new EnvironmentException( message );
      }
docs: Reads which shell the current user has as settings in the /etc/passwd file.
  
  @param args commandline arguments needed.
  
  @return The shell command used by the current user, such as /bin/bash