I'm working on a lab assignment for a class, which exemplifies
users | wc -w as displaying the number of users currently logged in. The instructor has asked we write the output of
users to a file (
users > file), while still displaying the count. My initial thought was to change the original example to simply read
users > file | wc -w, but I receive the error:
ambiguous output redirect
Our college's Unix lab has us working, by default in
tcsh, and I know the commands can differ between the shells. Is there a command that can accomplish this that I'm completely forgetting?