simple (and stupid) shell scripting question

Nerius Landys nlandys at gmail.com
Mon Feb 15 06:07:52 UTC 2010


#!/bin/sh

I have these lines in my script:

DIRNAME="`dirname \"$0\"`"
cd "$DIRNAME"
SCRIPTDIR="`pwd`"

What if I got rid of extra double quotes?  Like this:

DIRNAME=`dirname \"$0\"`
cd "$DIRNAME"
SCRIPTDIR=`pwd`

Does this behave any differently in any kind of case?  Are thes double
quotes just superfluous?


More information about the freebsd-questions mailing list