Mike Stroyan wrote: > 龙海涛 wrote: > > Bob Proulx wrote: > > > test=$(pwd) > > > echo $test > > By the way, the variable "$PWD" has the same current directory value > as "$(pwd)" .
Yes, you have a point, but... Even though this is a bash list I still prefer to use standard constructs when possible and practical. Since $PWD is a bash specific feature (would require #!/bin/bash) I would still tend to use $(pwd) because that works both in bash and in POSIX shells (would be okay with #!/bin/sh). Bob