Skip to content

Commit a780988

Browse files
authored
bugfix one example of 010-bash-conditionals (#159)
* bugfix conditionals * bugfix modify symbol '-' * bugfix modify ~/.bash_profile spelling
1 parent b08e01f commit a780988

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ebook/en/content/010-bash-conditionals.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ read -p "Enter your username? " username
8989

9090
# Check if the username provided is the admin
9191

92-
if [[ "${username}" != "${admin}" ]] || [[ $EUID != 0 ]] ; then
92+
if [[ "${username}" != "${admin}" ]] && [[ $EUID != 0 ]] ; then
9393
echo "You are not the admin or root user, but please be safe!"
9494
else
9595
echo "You are the admin user! This could be very destructive!"

ebook/en/content/011-bash-loops.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ The [n] argument is optional and can be greater than or equal to 1. When [n] is
135135

136136
for i in 1 2 3 4 5
137137
do
138-
if [[ $i eq 2 ]]
138+
if [[ $i -eq 2 ]]
139139
then
140140
echo "skipping number 2"
141141
continue
@@ -161,9 +161,9 @@ Example:
161161
#!/bin/bash
162162

163163
num=1
164-
while [[ $num lt 10 ]]
164+
while [[ $num -lt 10 ]]
165165
do
166-
if [[ $num eq 5 ]]
166+
if [[ $num -eq 5 ]]
167167
then
168168
break
169169
fi
@@ -184,7 +184,7 @@ do
184184
echo "outer loop: $a"
185185
for (( b = 1; b < 100; b++ ))
186186
do
187-
if [[ $b gt 5 ]]
187+
if [[ $b -gt 5 ]]
188188
then
189189
break 2
190190
fi

ebook/en/content/014-creating-custom-bash-commands.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Now if you log out and log back in, your alias would be lost. In the next step y
4848

4949
In order to make the change persistent, we need to add the `alias` command in our shell profile file.
5050

51-
By default on Ubuntu this would be the `~/.bashrc` file, for other operating systems this might be the `~/.bash_profle`. With your favorite text editor open the file:
51+
By default on Ubuntu this would be the `~/.bashrc` file, for other operating systems this might be the `~/.bash_profile`. With your favorite text editor open the file:
5252

5353
```bash
5454
nano ~/.bashrc

0 commit comments

Comments
 (0)