#! /bin/csh -f

#
# du-sess
#
# Original Author: Doug Greve
# CVS Revision Info:
#    $Author: nicks $
#    $Date: 2007/01/09 22:41:17 $
#    $Revision: 1.2 $
#
# Copyright (C) 2002-2007,
# The General Hospital Corporation (Boston, MA). 
# All rights reserved.
#
# Distribution, usage and copying of this software is covered under the
# terms found in the License Agreement file named 'COPYING' found in the
# FreeSurfer source code root directory, and duplicated here:
# https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferOpenSourceLicense
#
# General inquiries: freesurfer@nmr.mgh.harvard.edu
# Bug reports: analysis-bugs@nmr.mgh.harvard.edu
#


if($#argv == 0) then
  echo "USAGE: du-sess [sesspath args]"
  exit 1;
endif

set sesslist = `getsesspath $argv`;
if($status) then
  echo $sesslist
  exit 1;
endif

foreach sess ($sesslist)
  set sessid = `basename $sess`;
  pushd $sess > /dev/null
  cd ..
  set tmp = `du -s $sessid`;
  set dudat = $tmp[1];
  echo $sessid $dudat
  popd > /dev/null
end


exit 0;
