This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
github-actions
committed
Jun 20, 2023
1 parent
97a7c6a
commit aea43b3
Showing
6 changed files
with
1,400 additions
and
2 deletions.
There are no files selected for viewing
6 changes: 5 additions & 1 deletion
6
...uages f264e815b0b44efc9c8a8e4bd5e90850/Bash cd7f5163fd214780904b27a1b8049e60.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Bash | ||
|
||
[Conditions](Bash%20cd7f5163fd214780904b27a1b8049e60/Conditions%2072281a0500924f8d95b56288d02efc68.md) | ||
[Conditions](Bash%20cd7f5163fd214780904b27a1b8049e60/Conditions%2072281a0500924f8d95b56288d02efc68.md) | ||
|
||
[StdOut / StdIn Piping](Bash%20cd7f5163fd214780904b27a1b8049e60/StdOut%20StdIn%20Piping%20910e23eb8f874e74b8b66265a9a78326.md) | ||
|
||
[Function Returns](Bash%20cd7f5163fd214780904b27a1b8049e60/Function%20Returns%20e6c70228b89e4ec5a01feddc6a798677.md) |
19 changes: 19 additions & 0 deletions
19
...63fd214780904b27a1b8049e60/Function Returns e6c70228b89e4ec5a01feddc6a798677.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Function Returns | ||
|
||
Here is a simple example of a bash function returning a boolean. | ||
|
||
```bash | ||
function find_gofiles() { | ||
for dir in ${GOFILE_DIRS[*]}; do | ||
[ -n "$(find $dir -iname '**.go' 2> /dev/null)" ] && { | ||
# Store result in a variable | ||
GOFILES_DIR=$dir | ||
return 0 # ~ true | ||
} | ||
done | ||
|
||
return 1 # ~ false | ||
} | ||
|
||
find_gofiles && echo "Found in ${GOFILES_DIR}!" | ||
``` |
13 changes: 13 additions & 0 deletions
13
...d214780904b27a1b8049e60/StdOut StdIn Piping 910e23eb8f874e74b8b66265a9a78326.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# StdOut / StdIn Piping | ||
|
||
- Pipe only StdErr | ||
|
||
```bash | ||
find doesnotexist 2> /dev/null | ||
``` | ||
|
||
- Pipe both StdErr and StdOut | ||
|
||
```bash | ||
find doesnotexist > /dev/null 2>&1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.