How to find the newly created directory

Hi,

I need to create new directory by increasing the number by 1 of extracted lastly created directory.

e.g.
Log\out_log_1\
Log\out_log_2\
Log\out_log_3\

become
Log\out_log_1\
Log\out_log_2\
Log\out_log_3\
Log\out_log_4\

Can anyone help how to do it in c-shell script?:confused:

#!/bin/csh
ls -lrcu | egrep "^d" | awk 'NR==1{print $9}' | perl -ne '/(.+)(\d+)$/;print $1,$2+1' | xargs mkdir

Run it inside Log directory.

For the given example this should work..

ls -lrt Log | awk '{print $8}' | tail -1 | awk 'BEGIN{FS="-"}{print $1"-"$2"-"$3+1}' | xargs mkdir

-Raja

set f=`ls -1tr | tail -1 | sed 's/\(.*\)_.*/\1/'` ; set l=`ls -1tr | tail -1 | cut -d_ -f3` ; set l=`echo $l + 1 | bc` 
mkdir echo ${f}_$l