Published Book on Amazon
|All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1|
|All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2|
출판된 한글판 도서
|최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)|
|최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)|
Original Book Contents
10.4.2 "echo" Command
This command displays the specified text on standard output. It is not necessary for common task, but is often used to display information about various progresses when writing bash scripts.
echo [option] [string]
■ This displays the specified text on standard output.
■ User privilege -- Normal user.
■ [string] is expressed in the format "XXX"
do not output the trailing newline
enable interpretation of backslash escapes
disable interpretation of backslash escapes (default)
display this help and exit
In Shell, let's simply execute the echo command with the string "This is Raspberry Pi System" as follows. You can see that the specified string is displayed in the output as it is.
pi@raspberrypi ~ $ echo "This is Raspberry Pi System"
This is Raspberry Pi System
This time, we will try to express the string in several lines. To move to a new line in this command, you must use "＼n" to represent the new line. The following example shows that the specified string after the new line will be displayed on the second line.
pi@raspberrypi ~ $ echo -e "This is Pi System ＼nFrom this, the new line begins"
This is Pi System
From this, the new line begins