In the following pipeline, the find command (explained in Chapter 25) searches all the directories under /etc looking for fi les owned by userid root. The names of all such fi les are then written to standard output, one per line. The output of find is piped to wc -l to count the lines:
find /etc -type f -user root -print | wc –l
As find does its work, it will generate various error messages you don’t want to see. Your goal is to rewrite the pipeline to throw away the error messages without affecting the rest of the output. Show how to do this for the Bourne Shell family. For extra credit, see if you can devise a way to do it for the C-Shell family. (Hint: Use a subshell within a subshell.)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here