Created
December 24, 2015 14:25
-
-
Save DQNEO/c7c68f8f6e06eb4cfa9e to your computer and use it in GitHub Desktop.
$(pwd) vs $PWD comparison
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
#!/bin/bash | |
for i in $(seq 1 10000) | |
do | |
echo $(pwd) >/dev/null | |
done |
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
#!/bin/bash | |
for i in $(seq 1 10000) | |
do | |
echo $PWD >/dev/null | |
done |
$PWD
is a variable,$(pwd)
will execute the command pwd.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Benchmark results