Is there any Linux application that just prints whatever you give it WITHOUT doing ANY sort of interpretation? So regardless of what I send to it, it would always output exactly what I send to it?
I want something with the functionality of echo
or printf
, but without interpreting the \
and everything else.
Here's the kind of application I want:
newcommand "sa"" '' " "' ''""d f\sad\ f\sad\ \df\\ h\df\\\\\ sdf\h\sdfh\"" """" ''" " "ds\f\\\\ $%% \\as\ fsa\dg\ \afd\g\ \df\g \\df\g\\\\ n\ \n \\ sa\d \as \t a fsad g"" DF"G ""SD"F"" "DF"SG" """"Ds f"G" 'dsf'g 'sdf" G'ds f'g"SD fG"sd'f'g 'SFD""" ' > testfile1
cat testfile1
"sa"" '' " "' ''""d f\sad\ f\sad\ \df\\ h\df\\\\\ sdf\h\sdfh\"" """" ''" " "ds\f\\\\ $%% \\as\ fsa\dg\ \afd\g\ \df\g \\df\g\\\\ n\ \n \\ sa\d \as \t a fsad g"" DF"G ""SD"F"" "DF"SG" """"Ds f"G" 'dsf'g 'sdf" G'ds f'g"SD fG"sd'f'g 'SFD""" '
I can't find any program with this functionality. Basically, every positional parameter is outputted as is, including "
and '
. The only things that aren't outputted as-is would be |<>
for obvious reasons
Okay, here's an even better example of what I want:
I want something that does, in command line and in one single line, something that can be achieved using nano
or vi
and writing one full line of text.
printf
is indeed outputting exactly what it is given, and\t
comes out as\
followed byt
. – JdeBP Sep 21 '18 at 08:37printf
doing what you say that you want, and contradicting the question's premise thatprintf
is not doing, you have not adequately expressed your question. – JdeBP Sep 21 '18 at 08:51printf
also interprets the strings you give it. I want something simple that never interprets anything. If you pass something to id, whatever it is, it would just output it back the same way you gave it, which then you can redirect. Basically, the functionality of echo without interprets. – iamAguest Sep 21 '18 at 08:52printf
. You even have several examples in answers of it doing exactly that, printing out its arguments with%s
. The problem is indeed that your question is not clear, and an inadequate explanation of what you are asking for. – JdeBP Sep 21 '18 at 08:54printf
does NOT do what I asked. If it requires%s
to do it, then it does NOT do what I ask.%s
isprintf
INTERPRETING%s
as something other than plain%s
. What is my question? A program that DOESN'T interpret ANYTHING. Seriously, my question is not that hard! – iamAguest Sep 21 '18 at 09:00|<>
as input? How are you providing the input to this program? As arguments, or as stdin? – Jeff Schaller Sep 21 '18 at 10:56cat
is an application that doesn't interpret the text at all. If you want something likeecho
that outputs everything behind theecho
unmodified, that's impossible. For details, look up how the shell processes command lines. – RalfFriedl Sep 21 '18 at 16:56