-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecho_command.sh
More file actions
36 lines (33 loc) · 1.4 KB
/
Copy pathecho_command.sh
File metadata and controls
36 lines (33 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#############echo command in script of Shell Substitution############
The following escape sequences which can be used in echo command −
SYNOPSIS
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION
DESCRIPTION
Echo the STRING(s) to standard output.
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
#If -e is in effect, the following sequences are recognized:
Sr.No. Escape & Description
1 \\ backslash
2 \a alert (BEL)
3 \b backspace
4 \c suppress trailing newline (or) produce no further output
5 \f form feed
6 \n new line
7 \r carriage return
8 \t horizontal tab
9 \v vertical tab
10 \e escape
11 \0NNN byte with octal value NNN (1 to 3 digits)
12 \xHH byte with hexadecimal value HH (1 to 2 digits)
13 \s matches for space
NOTE: your shell may have its own version of echo, which usually supersedes the version described here. Please refer to your shells
documentation for details about the options it supports.
##We used echo -e to produce the input sequence. The -e option signals to echo to interpret escape sequences.
If the input is large we can use an input file and the redirection operator to supply input:
$ echo -e "notes\ndocx\n" > input.data
$ cat input.data
notes
docx