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...


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


Write 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<br>directory provided as the single argument. The directory names are printed one per line. It prints the directories only, not symbolic links to directories. Do this with a for-<br>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<br>red 302 % ./listdirs.sh /<br>boot<br>dev<br>ееcs<br>etc<br>home<br>jas<br>local<br>media<br>mnt<br>obj<br>opt<br>pkgcache<br>proc<br>root<br>run<br>srv<br>sys<br>tmp<br>usr<br>var<br>хconf<br>xsys<br>red 303 %<br>To submit your script enclose it in a tar file using the command<br>tar cf listdirs.tar listdirs.sh<br>

Extracted text: Write 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. 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 ееcs etc home jas local media mnt obj opt pkgcache proc root run srv sys tmp usr var хconf xsys red 303 % To submit your script enclose it in a tar file using the command tar cf listdirs.tar listdirs.sh
Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here