I'm having issues with piping the translate command into the word count command using the shell for an assignment. Using Debian 9 Linux distro.
I need to remove colons from the passwd file in the /etc directory and pipe the results into "word count" or wc -w. I have read the man pages, google searched and tried youtube videos, but could not find anything that would point me in the right direction. Things I have tried include:
tr -d ":" | wc -w /etc/passwd
tr -d [:punct:] | wc -w /etc/passwd
tr -- delete [:punct:] | wc -w /etc/passwd
tr -s [:punct:] [:space:] | wc -w /etc/passwd
tr -t [:] [" "] | wc -w /etc/passwd
The piped command is supposed to delete colons, replace them with spaces, and change the word count/"wc" commands output.
Before using translate and piping to wc, passwd's word count is equal to 37 lines, 60 words and 2054 bytes. I believe the number is supposed to increase when you remove the colons.