Last active
October 12, 2015 17:27
-
-
Save gatesphere/4061547 to your computer and use it in GitHub Desktop.
Stupid Bash Tricks
This file contains hidden or 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
a="hello" | |
b="world" | |
c=$a" there, isn't it a wonderful "$b"?" | |
echo $c |
This file contains hidden or 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
function hello-world { | |
local __resultvar=$1 | |
local __blah="Hello, world!" | |
eval $__resultvar="'$__blah'" | |
} | |
hello-world foo | |
echo $foo |
This file contains hidden or 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
for i in {1..100}; do | |
echo -ne "\r$i" | |
sleep .5 | |
done | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment