Re: incrementing number added to directory
- From: ulrich@xxxxxxxxxxx (Ulrich Schöbel)
- Date: 30 Aug 2005 15:23:23 GMT
In article <1125413379.213656.89640@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"Niv (KP)" <kev.parsons@xxxxxxxxxx> writes:
> Ta for that; the below now works.
> It was just getting the syntax just right, I was almost there
> by myself, but not quite.
> #-------------------------------------------------------------
> # initialise the module testbench directory counter.
> set n 00
> set uscore _
> # Create the test bench directory for each module.
> foreach entry $modules {
> incr n
> set m [format "%02d" $n]
> foreach bench_dir {FRED PETE KEV SIMON} {
> set longname [set m][set uscore][set entry]
> file mkdir $tbench_path/BENCH_ML_$longname/$bench_dir
> }
> }
> #-------------------------------------------------------------
Hi Niv,
a bit shorter and, IMHO, better readable:
# initialise the module testbench directory counter.
set n 0
# Create the test bench directory for each module.
foreach entry $modules {
set longname [format "BENCH_ML_%02d_%s" [incr n] $entry]
foreach bench_dir {FRED PETE KEV SIMON} {
file mkdir [file join $tbench_path $longname $bench_dir]
}
}
Best regards
Ulrich
.
- References:
- incrementing number added to directory
- From: Niv (KP)
- Re: incrementing number added to directory
- From: suchenwi
- Re: incrementing number added to directory
- From: Niv (KP)
- incrementing number added to directory
- Prev by Date: Re: UTF-8 Euro symbol problem
- Next by Date: Re: can TCL handle large string?
- Previous by thread: Re: incrementing number added to directory
- Next by thread: can TCL handle large string?
- Index(es):