# In this shell script, we will try creating and removing # directories, and look at listing their content. We already know # most of the commands involved, so this will be mainly review. set -x # let's ask the shell to print commands for us # We first create and enter a scratch directory (it is an error if # it already exists) mkdir scratch ; cd scratch # The ‹-p› switch to ‹mkdir› tells it to create any missing parent # directories. It is also not an error if the target directory # already exists, in this case. mkdir -p some/subdir mkdir -p some # We also know how to list directory contents, using ‹ls›: ls some # The ‹rmdir› command is the inverse of ‹mkdir›: it will remove an # empty directory; it is an error if the directory is not empty, # see: rmdir some # However, those are okay: rmdir some/subdir rmdir some cd .. rmdir scratch # Let's move on to the C programs again: we'll now look at # ‹rmmkdir.c›. We will skip ‹ls› for now because it's a little more # complicated. But we will get to it near the end of the seminar # today.