The initial if statement will test if the file is a regular file. More on file test operators here.
This script will echo the characters {query}
and pipe it to the command tr
, which with the -d
will delete characters that are specified. tr
stands for translate. In this case it takes a SET and per the man page, it will delete backslashes if you use \\
.
The result is stored in $in
.
Finally, the result stored in in
will be outputted to saved.text
.
NAME tr - translate or delete characters
SYNOPSIS tr [OPTION]... SET1 [SET2]
DESCRIPTION Translate, squeeze, and/or delete characters from standard input, writing to standard output.
-c, -C, --complement first complement SET1 -d, --delete delete characters in SET1, do not translate -s, --squeeze-repeats replace each input sequence of a repeated character that is listed in SET1 with a single occurrence of that character -t, --truncate-set1 first truncate SET1 to length of SET2 --help display this help and exit --version output version information and exit SETs are specified as strings of characters. Most represent themselves. Interpreted sequences are: \NNN character with octal value NNN (1 to 3 octal digits) \\ backslash