I'm trying to find a project to work on to improve coding skills and
contribute to the community. So I thought that possibly a command line
program would be useful that does similar things as Perl's trim function
and PHP's trim function.
So .. Would it be worth creating a new program, let's call it 'trim', that
would: 1) remove whitespace from the beginning and end of stdin; and 2)
remove newlines from beginning and end of a file?
Example usage:
echo " test test test test " | trim
Would output:
test test test test
Example usage:
trim myfile.txt
cat myfile.txt | trim
Would output:
This is line one of two
from a test file.
This is line two of two
from a test file.
Where myfile.txt contains this:
\n
\n
This is line one of two
from a test file.
This is line two of two
from a test file.
\n
\n