#!/bin/csh ## Lists all directory files in given directory if ( $#argv != 1 ) then echo usage: $0 directory; exit(1) endif set workdir = `pwd` set dir = $1 cd $dir set files = * echo 'List of directory files in '$dir':' foreach file ($files) if ( -d $file ) then echo $file endif end cd $workdir