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
b7340c5e
Commit
b7340c5e
authored
8 years ago
by
Michael Aaron Murphy
Browse files
Options
Downloads
Patches
Plain Diff
Update Readme
parent
b98b1c3f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+36
-4
36 additions, 4 deletions
README.md
with
36 additions
and
4 deletions
README.md
+
36
−
4
View file @
b7340c5e
...
...
@@ -96,15 +96,33 @@ command arg1 arg2 arg3
command arg1 arg2 arg3; command arg1 arg2 arg3; command arg1 arg2 arg3
```
### Pip
elines
& Redirecti
ons
### Pip
ing
& Redirecti
ng Standard Output
It's currently only possible to pipe and redirect the standard output of one command to another command.
The pipe (
`|`
) and redirect (
`>`
) operators are used for manipulating the standard output.
```
ion
command arg1 | other_command | another_command arg2
command arg1 > file
```
### Piping & Redirecting Standard Error
The
`^|`
and
`^>`
operators are used for manipulating the standard error.
```
ion
command arg1 ^| other_command # Not supported yet
command arg1 ^> file
```
### Piping & Redirecting Both Standard Output & Standard Error
The
`&|`
and
`&>`
operators are used for manipulating both the standard output and error.
```
ion
command arg1 &| other_command # Not supported yet
command arg1 &> file
```
### Conditional Operators
The Ion shell supports the
`&&`
and
`||`
operators in the same manner as the Bash shell. The
`&&`
operator
...
...
@@ -146,7 +164,8 @@ end
### For Loops
For loops, on the other hand, will take a variable followed by a list of values or a range expression, and
iterate through all contained statements until all values have been exhausted.
iterate through all contained statements until all values have been exhausted. If the variable is
`_`
, it
will be ignored.
```
ion
# Obtaining Values From a Subshell
...
...
@@ -168,6 +187,11 @@ end
for a in 1...10
echo $a
end
# Ignore Value
for _ in 1..10
do_something
end
```
### Functions
...
...
@@ -183,7 +207,7 @@ fn fib n
else
let output = 1
let previous = 1
for
index
in 2..$n
for
_
in 2..$n
let temp = $output
let output += $previous
let previous = $temp
...
...
@@ -196,3 +220,11 @@ for i in 1..20
fib $i
end
```
### Brace Expansion
It is possible to perform brace expansions within the Ion shell. Currently, only permutation braces are supported.
```
ion
echo abc{1,2,3}def{456,789,101112}
```
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