I have to create a script ( an one-liner more exactly) that will receive as an argument the link to a directory( ex /home/stan/direct).The directory (in my exemple is direct) contain an
unknown number of directories and files.Those files contain words separated by one ","(comma) ,one " "(space) or one "/n"(new line) .The script must count the printable characters from all those files (exception " " and ",") and print the result and also to redirect all the errors that occur while runing the script in a file named errors.txt.
And now my question ? How can i make such a script(one-liner) ?
First filter out which is not printable, then count what left:
sed 's/[^a-zA-Z0-9]//g'|wc -c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With