toys

Tools and things that make my life easier - y'all might like them too

View the Project on GitHub pfuntner/toys

nocrs

Purpose

Remove carriage returns from files. This is especially useful for files created on Windoze that have carriage returns - one of the worst things about Windoze, in my opinion.

Syntax

Syntax: nocrs [-v] file ...

Options and arguments

| Option | Description | Default | | —— | ———– | ——- | | -v, --verbose | Increase debugging messages. More instance of this option produce more debugging. | Debugging is not enabled |

Arguments

Each file to process is specified as an argument on the command line.

Example

$ echo -e 'This is a test\r' > test
$ od -ctx1 test
0000000   T   h   i   s       i   s       a       t   e   s   t  \r  \n
         54  68  69  73  20  69  73  20  61  20  74  65  73  74  0d  0a
0000020
$ nocrs test
test
$ od -ctx1 test
0000000   T   h   i   s       i   s       a       t   e   s   t  \n
         54  68  69  73  20  69  73  20  61  20  74  65  73  74  0a
0000017
$
$ echo -e 'This is a test\r' > test
$ nocrs -v test
2019-02-17 10:23:56,404 INFO /home/mrbruno/bin/nocrs:45 processing test
2019-02-17 10:23:56,404 INFO /home/mrbruno/bin/nocrs:25 Backing up 'test' to '.test-20190217102356'
test
$

Notes