Thank you all for all your assistance, your support is highly appreciated.
As grail suggested and as catkin has done, here comes a better picture of what I am trying or want to do.
Code:
[user01@centos-flash test]$ls -R|find -type d|grep -v "do_not_delete*"
.
./t1
./t2
./t2/s1
./t2/b1
./t2/b1/b11
./t2/b1/b12
./t3
./t4
./t5
./t6
./t7/x1
./t7/x1/x11
./t7/x1/x12
./t8
./t9
./t9/z1
./t9/z2
[user01@centos-flash test]$pwd
/x/y/z/test
[user01@centos-flash test]$ls -R|find -type d
.
./t1
./t2
./t2/s1
./t2/b1
./t2/b1/b11
./t2/b1/b12
./t3
./t4
./t5
./t6
./t7/x1
./t7/x1/x11
./t7/x1/x12
./t8
./t9
./t9/z1
./t9/z2
./do_not_delete
./do_not_delete_later
Note that test in my current working directory and all directories beneath it are shown here, I have changed names to keep security freaks happy.
What I want is, I should go to directory
t1, run command p4 diff -f * as that is the only directory and there are no more directories underneath it.
Once I am done then come back to
test directory or go to directory
t2, now t2 is interesting directory,
Let us have a look at its structure,
Code:
./t2
./t2/s1
./t2/b1
./t2/b1/b11
./t2/b1/b12
it has
two directories underneath it and
1 sub-directory(b1) has again
two sub-directories.
So I ideally I want something like go to t2/b1/b12 run p4 diff -f * command, then go to t2/b1/b11 run p4 diff -f * command
once I have covered both b11 and b12 directories I should not run p4 diff -f * command in /t2/b1 directory as the output is misleading.
Come back to t2/s1 again run command p4 diff -f *, come back to t2 directory, now when I run p4 diff -f * command in t2 directory it should eliminate all sub-directory(ies) and this procedure is repeated so on and so forth until t9..
Earlier I was doing "hard coding"
so my for loop was
Code:
for i in "t1 t2 t3 .."
do
p4 diff -f *
done
then I thought its not good idea as we start doing expansion under those directories we would be losing lots of information and reporting won't be a rock solid solution.
so I thought lets us something called as parametrized directory names and this idea was born...
so it would something like this
Code:
for i in $(ls -R|find -type d)
but there are complications in running p4 diff command as perforce doesn't recognize directory but a file.
This is what I want to do.
Not sure if its complex or easy to implement.