The substitution ($)

We already know this and have used it for the variable substitution that allows us to access the content of a variable:

zarrelli:~$ x=10 ; echo $x
10

But it is also used in a regular expression to match at the end of a line:

ls | grep [[:digit:]]$
1
2
3
test.colon.2

In this example, the output of ls is filtered on that file whose name ends with a single integer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.70.255