I understand what this command is saying or doing but I want to know what the :\c
means?
print "Running Tests (this might take a while):\c"
I understand what this command is saying or doing but I want to know what the :\c
means?
print "Running Tests (this might take a while):\c"
In the ksh93
shell, there is a print
utility built into the shell. This utility understands a number of escape sequences. One of these is \c
.
This is from the ksh93
manual in the section relating to the print
utility:
\c
Causes
This is thus something that makes it output a string without adding a newline at the end of the output. The next piece of output that your script is generating would occur on the same line, directly after the text Running Tests (this might take a while):
.
This works in a similar fashion in the zsh
shell.
For future reference, it would be nice if you could specify what shell you are working with, especially when you are using nonstandard utilities like print
that may work differently in different shells.
zsh
's echo
though, but it seems to do the same thing.
– Kusalananda
Oct 10 '18 at 13:28
echo
, printf
, print
, and pushln
are all implemented by a single bin_print()
function in the Z shell, distinguishing amongst them where necessary by flags passed to the function. Processing of \c
appears from a quick review to be common code.
– JdeBP
Oct 10 '18 at 13:40
):\c
seems a cow. Perhaps it is an emoticon. – andcoz Oct 10 '18 at 12:47print
command, see https://unix.stackexchange.com/questions/474501/ . – JdeBP Oct 10 '18 at 13:08