-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from DeNepo/02-variables-and-shell-expansions
add 02-variables-and-shell-expansions
- Loading branch information
Showing
168 changed files
with
3,006 additions
and
599 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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,34 +1,32 @@ | ||
#!/bin/bash | ||
#!/opt/homebrew/bin/bash | ||
|
||
# Author: Samir M. | ||
# Date: 2024-03-12 | ||
# Modified: 2024-03-12 | ||
# Version: 1.0 | ||
# Description: Add and remove scripts to/from the PATH | ||
# Usage: ./05.sh | ||
|
||
#-------------------------------------------------------------# | ||
|
||
|
||
# To see the PATH variable, you can use the following command | ||
echo "{$PATH}" | ||
|
||
# Add scripts to the PATH allows you to run the script from any directory without specifying the full path | ||
|
||
## To add 0-examples to the PATH, you can use the following command (replace the path with your own) | ||
export PATH=$PATH:$HOME/Desktop/work/master-classes/bash-scripting/00-build-bash-script/0-examples | ||
export PATH=$PATH:$HOME/Desktop/denepo/bash-scripting/00-build-bash-script/0-examples | ||
|
||
echo "{$PATH}" | ||
|
||
## To remove 0-examples from the PATH, you can use the following command (replace the path with your own) | ||
export PATH=${PATH%:"$HOME"/Desktop/work/master-classes/bash-scripting/00-build-bash-script/0-examples} | ||
export PATH=${PATH%:"$HOME"/Desktop/denepo/bash-scripting/00-build-bash-script/0-examples} | ||
|
||
echo "{$PATH}" | ||
|
||
exit 0 | ||
|
||
#-------------------------------------------------------------# | ||
exit 0 | ||
|
||
# How to run the script: | ||
# 1. Open the terminal | ||
# 2. `chmod 744 <path-to-the-script>` | ||
# 3. `./<path-to-the-script>` | ||
# 3. `./<path-to-the-script>` |
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
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
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,33 +1,22 @@ | ||
#!/bin/bash | ||
#!/opt/homebrew/bin/bash | ||
|
||
# _______: Samir M. | ||
# Date: 2024-03-12 | ||
# Modified: 2024-03-12 | ||
# Version: 1.0 | ||
# Description: echo command | ||
# ______: ./01.sh | ||
|
||
#-------------------------------------------------------------# | ||
|
||
echo "__________ first example" # Hello, World! first example | ||
|
||
echo -e "__________ second example" | ||
echo -e "__________ second example" | ||
# Hello, | ||
# World! second example | ||
|
||
echo -e "__________ third example" # Hello, World! third example | ||
|
||
# What is the difference between the three echo commands above? | ||
|
||
exit 0 | ||
#-------------------------------------------------------------# | ||
|
||
# How to run the script: | ||
# 1. Open the ________ | ||
# 2. `chmod ___ <path-to-the-script>` | ||
# 3. `./<path-to-the-script>` | ||
|
||
|
||
|
||
|
||
|
||
|
||
exit 0 |
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
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
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.