Skip to content

Instantly share code, notes, and snippets.

@DQNEO
Created December 24, 2015 14:25
Show Gist options
  • Select an option

  • Save DQNEO/c7c68f8f6e06eb4cfa9e to your computer and use it in GitHub Desktop.

Select an option

Save DQNEO/c7c68f8f6e06eb4cfa9e to your computer and use it in GitHub Desktop.
$(pwd) vs $PWD comparison
#!/bin/bash
for i in $(seq 1 10000)
do
echo $(pwd) >/dev/null
done
#!/bin/bash
for i in $(seq 1 10000)
do
echo $PWD >/dev/null
done
@miy4mori

miy4mori commented Jun 4, 2017

Copy link
Copy Markdown

$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