Is ^L is considered a non printing character? The reason for the question my man pages for cat say -v will print non printing characters ^L is not showing up either way with or without -v.
the ^L (aka FORM FEED) is not a printing character
cat example
this has
embedded
characters in the file
![]()
Hi,
On Linux with GNU cat at least, I cannot replicate this, with things seeming to work as expected on my own RHEL 7.9 x86_64 test system:
# cat lf.txt
This
has
embedded
line
feeds
# cat -v lf.txt
This^Lhas^Lembedded^Lline^Lfeeds
#
If you can confirm your operating environment details, then we may be able to assist further.
on a macbook pro ...
cat --version
cat (GNU coreutils) 9.1...
cat -v example
this has ^Lembedded^Lcharacters in the file
cat example
this has
embedded
characters in the file
on Linux Mint 20.2 Uma
cat --version
cat (GNU coreutils) 8.30 ...
cat -v input
This has ^Lembedded NON-PRINTING contro-L (aka FORM FEED)^Lcharacters
cat input
This has
embedded NON-PRINTING contro-L (aka FORM FEED)
characters
Some terminal implementations ignore the FF character:
# echo 'hello ^L world'
hello world
However, cat -v must show the ^L (actually it prints the two characters ^ and L).
# echo 'hello ^L world' | cat -v
hello ^L world
# echo 'hello ^L world' | tr '\014' '_'
hello _ world
BTW all terminals should allow to enter the ^L character after a ^V character.
: uname -a
SunOS ah5719006ub002 5.10 Generic_150400-64 sun4u sparc SUNW,SPARC-Enterprise
I am using an ancient version of SunOS.
@cokedude,
just to be clear... the displayed ^L (using cat -vet or whatever) is actually ONE character (NOT two),
In vi (e.g.) or in the shell supporting vi-type command line editing option (set -o vi), you would enter ^L as:
- press and hold
CTRL - hit
V - hit
L
@MadeInGermany has shown how to specify ^L as octal for tr - the same should be true for other text processing tools (grep, awk etc).