Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ion
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Enzo Cioppettini
ion
Commits
2c8601d4
Unverified
Commit
2c8601d4
authored
7 years ago
by
Nagy Tibor
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix string comparisons in documentation
The builtin test command expects `=` for string comparisons, not `-eq`
parent
fffdddcd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
manual/src/ch07-01-conditionals.md
+3
-3
3 additions, 3 deletions
manual/src/ch07-01-conditionals.md
with
3 additions
and
3 deletions
manual/src/ch07-01-conditionals.md
+
3
−
3
View file @
2c8601d4
...
@@ -24,7 +24,7 @@ builtin, which may be convenient to use in conjuction with other commands in ord
...
@@ -24,7 +24,7 @@ builtin, which may be convenient to use in conjuction with other commands in ord
the exit status; and a
`matches`
builtin that performs a regex-based boolean match.
the exit status; and a
`matches`
builtin that performs a regex-based boolean match.
```
sh
```
sh
if
test
"foo"
-eq
$foo
if
test
"foo"
=
$foo
echo
"Found foo"
echo
"Found foo"
else if
matches
$foo
'[A-Ma-m]\w+'
else if
matches
$foo
'[A-Ma-m]\w+'
echo
"we found a word that starts with A-M"
echo
"we found a word that starts with A-M"
...
@@ -72,7 +72,7 @@ can be skipped over and conditionally-executed based on return status. This enab
...
@@ -72,7 +72,7 @@ can be skipped over and conditionally-executed based on return status. This enab
expressing some patterns better than could be done with an if statement.
expressing some patterns better than could be done with an if statement.
```
ion
```
ion
if test $foo
-eq
"foo" && test $bar
-eq
"bar"
if test $foo
=
"foo" && test $bar
=
"bar"
echo "foobar was found"
echo "foobar was found"
else
else
echo "either foo or bar was not found"
echo "either foo or bar was not found"
...
@@ -80,7 +80,7 @@ end
...
@@ -80,7 +80,7 @@ end
```
```
```
ion
```
ion
test $foo
-eq
"foo" && test $bar
-eq
"bar" &&
test $foo
=
"foo" && test $bar
=
"bar" &&
echo "foobar was found" ||
echo "foobar was found" ||
echo "either foo or bar was not found"
echo "either foo or bar was not found"
```
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment