coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Utility of new program for coreutils?


From: Tony Freeman
Subject: Utility of new program for coreutils?
Date: Fri, 2 Jun 2017 04:32:15 -0500

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]