I have most of what I need so far I'm just unsure of the grep command to get only directories or if there isn't one. For context, this is the original request:
This script should take a single command line argument which will be a path to a directory. (done) The script should make sure that the path is, in fact, a directory and that the user had read permission on it. (done) Your program should then capture the output of an ls command on the directory. (done) It should then print out the names of only the sub-directories that are found. Files should be ignored. (???)
I have so far:
#!/bin/bash
if [ -d $1 ] && [ -r $1 ] ; then
ls -l $1 | tee output | grep ______
fi