From 61dc67b5d2febd302c96cee2821ac190fdd24c4a Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Wed, 24 Jul 2019 18:00:32 -0400 Subject: [PATCH] Simple find assignment --- labs/xv6.html | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/labs/xv6.html b/labs/xv6.html index 1749ca6..a5df08d 100644 --- a/labs/xv6.html +++ b/labs/xv6.html @@ -144,18 +144,29 @@ initial file system. You just ran one of them: ls.

find

Write a simple version of the UNIX find program: find all the files - in a directory tree that contain a user-specified string. + in a directory tree whose name matches a string. For example if the + file system contains a file a/b, then running find as + follows should produce: +

+    $ find . b
+    ./a/b
+    $
+  

Some hints:

+
  • Use recursion to run find in sub-directories. +
  • Don't recurse into "." and "..". + -

    Optional: modify shell

    +

    Optional: modify the shell

    Modify the shell to support lists of commands, separated by ";" -

    Modify the shell to support sub-shells by implementing "(" and ")" +

    Modify the shell to support sub-shells by implementing "(" and ")" + +

    Modify the shell to allow users to edit the command line