PDA

View Full Version : question about testing in shell programming



thungmail
04-07-2008, 10:00 PM
I have 2 different directories. The first has 2 sub-folders A and B. The second as 2 sub-folders C and D and script named "script".There is a code of "script" to list 2 sub-folders C and D


#!/bin/sh
for file in *
do [ -d $file ] && echo $file
done

I would like to ask how can I make a change if I would like to list 2 sub-folders A and B in the first directory ( using "script" )

Salem
04-07-2008, 11:18 PM
find .. -type d