In a short bash script named listdirs.sh that lists the names of the directories (the names only not the files contained in the directory) that are within the the directory provided as the single argument. The directory names are printed one per line. It prints the directories only, not symbolic links to directories. Please do this with a for-loop that for each entry to the directory provided as argument checks if it is a directory and if it is prints its name. If you run your script on red you should get
red 302 % ./listdirs.sh /
boot
dev
eecs
etc
home
jas
local
media
mnt
obj
opt
pkgcache
proc
root
run
srv
sys
tmp
usr
var
xconf
xsys
red 303 %
To submit your script enclose it in a tar file using the command
tar cf listdirs.tar listdirs.sh
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here