#!/bin/sh dir=$1 cd $dir find dicom/ -name "*.dcm" > dcm_files dcdirmk -f dcm_files > dicomdir rm dcm_files cd ..