Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken page links (a couple of documents) #2160

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 24 additions & 28 deletions docs/books/sed_awk_grep/4_awk_command.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Awk command
author: tianci li
contributors:
contributors:
tags:
- awk
---
Expand Down Expand Up @@ -55,7 +55,7 @@ Although `awk` is a tool for processing text, it has some programming language f
A simple example that is easy to understand:

```bash
Shell > df -hT
Shell > df -hT
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|Filesystem | Type | Size | Used | Avail | Use% | Mounted | on |←← 1 (first line)
|devtmpfs | devtmpfs | 1.8G | 0 | 1.8G | 0% | /dev | |←← 2
Expand Down Expand Up @@ -889,7 +889,7 @@ ID Name
discard 9/dccp # Discard SC:DISC
...
```

3. Basic operations in mathematics

```bash
Expand Down Expand Up @@ -929,7 +929,7 @@ ID Name
...
```

4. Pipe symbol<a id=ps></a>
4. Pipe symbol

You can use the bash command in the awk program, for example:

Expand Down Expand Up @@ -964,7 +964,7 @@ ID Name
ssh 22/tcp # The Secure Shell (SSH) Protocol
sshell 614/tcp # SSLshell
ssh-mgmt 17235/tcp # SSH Tectia Manager

Shell > cat /etc/services | grep -v -E "(^#)|(^$)" | awk '$2!~/(tcp)|(udp)/ {print $0}'
http 80/sctp # HyperText Transfer Protocol
bgp 179/sctp
Expand Down Expand Up @@ -1020,14 +1020,14 @@ ID Name
Multiple branches:

```bash
Shell > cat /etc/services | awk '{ \
if($1~/netbios/)
{print $0}
else if($2~/175/)
{print "175"}
else if($2~/137/)
{print "137"}
else {print "no"}
Shell > cat /etc/services | awk '{ \
if($1~/netbios/)
{print $0}
else if($2~/175/)
{print "175"}
else if($2~/137/)
{print "137"}
else {print "no"}
}'
```

Expand Down Expand Up @@ -1136,14 +1136,14 @@ ID Name
}
}'

1
2
4
5
6
7
8
9
1
2
4
5
6
7
8
9
10
```

Expand Down Expand Up @@ -1313,7 +1313,7 @@ Like most programming languages, `awk` also supports arrays, which are divided i
Shell > cat /var/log/secure | egrep -o "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | awk ' \
{
a[$1]++
}
}
END{
for(v in a) print a[v],v
}
Expand Down Expand Up @@ -1356,7 +1356,7 @@ Like most programming languages, `awk` also supports arrays, which are divided i

```bash
Shell > ss -tulnp | awk -F " " '/tcp/ {a[$2]++} END{for(i in a) print a[i],i}'
2 LISTEN
2 LISTEN
```

8. Print lines based on the number of occurrences of a specific field
Expand Down Expand Up @@ -1625,8 +1625,6 @@ Like most programming languages, `awk` also supports arrays, which are divided i
```

Just like the `sed` command, you can also use the "&" symbol to reference already matched strings.

[Review that here](#symbol).

```bash
Shell > vim /tmp/tmp-file1.txt
Expand Down Expand Up @@ -1735,7 +1733,7 @@ Like most programming languages, `awk` also supports arrays, which are divided i
cloudcheck-ping 45514/udp # ASSIA CloudCheck WiFi Management keepalive
cloudcheck 45514/tcp # ASSIA CloudCheck WiFi Management System
spremotetablet 46998/tcp # Capture handwritten signatures

# I need this part of the content - "tablet"
Shell > tail -n 5 /etc/services | awk '/^sp/ {print substr($1,9)}'
tablet
Expand Down Expand Up @@ -1990,8 +1988,6 @@ Like most programming languages, `awk` also supports arrays, which are divided i

7. pipe character

See [here](#ps)

8. Custom functions

syntax - `function NAME(parameter list) { function body }`. Such as:
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/email/02-basic-email-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Then, let's add our domain entries in MySQL:
```sql
Mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY 'rockylinux.me';

Mysql > create user 'mailrl'@'%' identified by 'mail.rockylinux.me';
Mysql > create user 'mailrl'@'%' identified by 'mail.rockylinux.me';

Mysql > grant all privileges on *.* to 'mailrl'@'%' with grant option;
```
Expand Down Expand Up @@ -231,7 +231,7 @@ Mysql > insert into virtual_aliases(id,domain_id,source,destination) values(1,1,
Mysql > insert into virtual_aliases(id,domain_id,source,destination) values(2,1,'all@mail.rockylinux.me','leeo@mail.rockylinux.me');
```

The password entries for the relevant email users are not shown here, as it requires using `doveadm pw -s SHA512-crypt -p twotestandtwo` command. See [here](#ap1)
The password entries for the relevant email users are not shown here, as it requires using `doveadm pw -s SHA512-crypt -p twotestandtwo` command.

#### Knowledge of SHA512 (SHA-2)

Expand Down Expand Up @@ -374,7 +374,7 @@ mydomain = rockylinux.me
myorigin = $myhostname
inet_interfaces = 192.168.100.6
inet_protocols = ipv4
mydestination =
mydestination =
biff = no
append_dot_mydomain = no
smtpd_sasl_type = dovecot
Expand All @@ -401,7 +401,7 @@ mydomain = rockylinux.me
myorigin = $myhostname
inet_interfaces = 192.168.100.6
inet_protocols = ipv4
mydestination =
mydestination =
biff = no
append_dot_mydomain = no
smtpd_sasl_type = dovecot
Expand Down
Loading