implements the wc command in linux shell