I have something a bit tricky here and not sure how to go about fixing it.
I am doing a ls on a directory to obtain a list of databases within a directory and assigning it to a string as you can see from below. The problem is there is a folder in there called apache. I do not want this to be included in the string. How can I strip apache from the string Home_Databases? Or better yet even tell it to ignore any folders called apache when doing the ls.
cd $Dump_Directory
Home_Databases=`ls`
for data_base in $Home_Databases
do
space=`df -bhk $Dump_Directory$data_base/dump | cut -d "y" -f1 | awk '{print$5}'`
Capacity2=${space%?}
Capacity=$space
Thanks for the help. I am really stuck on this one.