File tree Expand file tree Collapse file tree 4 files changed +20
-16
lines changed Expand file tree Collapse file tree 4 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 1
1
2
2
# aliases/
3
3
4
- This directory contains aliases. Aliases also constitute as frequently used short functions.
4
+ This directory contains aliases and frequently used short functions.
5
5
6
6
## View
7
7
8
- To view all aliases, cd to the aliases directory and run the following:
8
+ Cd to this directory and run the following to view the solutions in it :
9
9
10
10
``` bash
11
- s=' view-Shell-aliases.sh' && git show helper_scripts:" ${s} " > /tmp/" ${s} " && \
12
- chmod +x /tmp/" ${s} " && /tmp/" ${s} "
11
+ git show-ref --verify -q refs/heads/helper_scripts || \
12
+ git branch --track helper_scripts origin/helper_scripts; \
13
+ bash <( git show helper_scripts:view-shell-aliases.sh)
13
14
```
14
15
15
16
## Usage
16
17
17
- To source all the aliases files in your .bashrc, add the following :
18
+ Add the following to your .bashrc to source all the aliases and short functions in your bash runtime :
18
19
19
20
``` bash
20
- for f in $( find < path/to/Shell > /aliases -type f -name ' *.aliases*' ) ; do
21
- . " ${f } "
21
+ for shellAliasesFile in $( find < path/to/shell > /aliases -type f -name ' *.aliases*' ) ; do
22
+ . " ${shellAliasesFile } "
22
23
done
23
24
```
24
25
Original file line number Diff line number Diff line change @@ -7,10 +7,11 @@ Functions scripts are scripts consisting of small functions relative to a larger
7
7
8
8
## View
9
9
10
- To view all functions scripts, cd to the functions_scripts directory and run the following:
10
+ Cd to this directory and run the following to view the solutions in it :
11
11
12
12
``` bash
13
- s=' view-Shell-functions-scripts.sh' && git show helper_scripts:" ${s} " > /tmp/" ${s} " && \
14
- chmod +x /tmp/" ${s} " && /tmp/" ${s} "
13
+ git show-ref --verify -q refs/heads/helper_scripts || \
14
+ git branch --track helper_scripts origin/helper_scripts; \
15
+ bash <( git show helper_scripts:view-shell-functions-scripts.sh)
15
16
```
16
17
Original file line number Diff line number Diff line change @@ -5,10 +5,11 @@ This directory contains one-liners.
5
5
6
6
## View
7
7
8
- To view all one-liners, cd to the one-liners directory and run the following:
8
+ Cd to this directory and run the following to view the solutions in it :
9
9
10
10
``` bash
11
- s=' view-Shell-one-liners.sh' && git show helper_scripts:" ${s} " > /tmp/" ${s} " && \
12
- chmod +x /tmp/" ${s} " && /tmp/" ${s} "
11
+ git show-ref --verify -q refs/heads/helper_scripts || \
12
+ git branch --track helper_scripts origin/helper_scripts; \
13
+ bash <( git show helper_scripts:view-shell-one-liners.sh)
13
14
```
14
15
Original file line number Diff line number Diff line change @@ -5,10 +5,11 @@ This directory contains scripts.
5
5
6
6
## View
7
7
8
- To view all scripts, cd to the scripts directory and run the following:
8
+ Cd to this directory and run the following to view the solutions in it :
9
9
10
10
``` bash
11
- s=' view-Shell-scripts.sh' && git show helper_scripts:" ${s} " > /tmp/" ${s} " && \
12
- chmod +x /tmp/" ${s} " && /tmp/" ${s} "
11
+ git show-ref --verify -q refs/heads/helper_scripts || \
12
+ git branch --track helper_scripts origin/helper_scripts; \
13
+ bash <( git show helper_scripts:view-shell-scripts.sh)
13
14
```
14
15
You can’t perform that action at this time.
0 commit comments