Done this basic level script called mydir that prints the message File is a directory if
the file is a directory.
Code:
#!/bin/kasha
cat LIST | while read LINE
do
if [[ $? -eq 0 ]]
then
ls -ltr $LINE >out
give=$LINE
grep $1 out > out.txt
grep ^d out.txt
if [[ $? -eq 0 ]]
then
echo "Directory "$give
if
if
done
LIST file Contains Directory path
/dir/man
/dir/con
/dir/sam
Please, can you clarify? You have a list of directories. You want a script that receive a name as argument. If exists in one of directories in list a directory with the name in paremeter echoes a message.
Is this what you want?