[clug] Circumflex
Bryan Kilgallin (iiNet)
kilgallin at iinet.net.au
Mon Aug 21 03:52:21 UTC 2017
Cheers, Scott:
> You can test for dos text files in a directory with:-
> grep -lU $'\x0D' *
>
> (which matches on the hex for CRLF)
That worked.
> or grep a file for a line that end with a carriage return:-
> [[ $(grep -c $'\r$' crlf.txt) -gt 0 ]] && echo dos
In bash, that worked. Though I couldn't translate for the fish shell,
which yielded "illegal command" error.
--
www.netspeed.com.au/bryan/
More information about the linux
mailing list