Subject: Home Depot Survey Rewards (CashBack)

From: Home Depot Voucher <[email-masked]>
Date: Tue, 08 Jul 2014 13:05:18 -0700

Trouble Viewing the Image Below? Click Here to Redeem Gift Card

Do you shop at Home Depot?

Share Your Opinion and Home Depot experiences

by completing the survey and

Redeem $50 Gift-Card Here!

Tool & Truck Rental | Installation Services & Repair | Help |

To customize the settings for your profile and subscriptions,click here or write to Current Update Alerts

at 1644 Doral Dr Brookings, SD 57006

s You're absolutely right about the quotes around the assignment being unnecessary. I had to try it to believe it. Learned something new todayyran" and then a=x or a={x/ryran/bob jones} or a=(echo x) ryran Mar 8 '12 at 18:54 however I ran into a really weird problem. I have a funky command prompt defined, and when using this exact method I was getting unprintable characters in my DIR. I fixed it by using the following: DIR="( cd "( dirname "{BASH_SOURCE[0]}" )" >/dev/null 2>&1 & with a relative symlink, I found I needed DIR="( cd "( dirname "{BASH_SOURCE[0]}" )" && cd -P "( dirname "SOURCE" )" && pwd )" yes, but beware that you cannot portably expect local a=x or export a=x to work the same way. I'm not sure about a=x foo, where foo is some command or builtin, but I suspect that you can't portably rely on the assignment behavior you describe ther
e either.Hmm. What do you mean "portably expect"? I don't see how you'd have any trouble with any of it -- local/export, whatever. It all works in every version of BASH (and we're only talking about BASH here). As far as "a=x foo where foo is some command or builtin" ... I'm not sure what you're trying to say there" I did mean in other shells. Granted this discussion is bash-specific, but it's worth being aware of what idioms one is using that may unexpectedly break in dash, ash, etc. It's easy to remember that [[ ]] is non-portable; more suprising that local a=x with no quotes around the x is too. I just checked BSD sh (a species of ash): here local a=x only assigns the first word of x's expansion to a; similarly with export. But a=x ./foo will (temporarily) assign the whole contents of x's expansion to a. m: I hear you and you're right that it's good to be aware. I don't care though, because I don't ever code shell scripts in anything other than bash sin
ce virtually every linux distro comes with gnu bash installed. (I don't mean as the default shell; I just mean installed and available for bash scrt version does not work in cygwin when the path is like "C:\...". Output of cd is : No such file or directoryabc where abc is the end of the directory name that contains the script. Second version works thouorks when using source /path/scriptname hugemt cd to other directory before this code, otherwise it will be wrong. _SOURCE was added for debugging purposes in version bash-3.0-alpha. So if you are working with a legacy system thSometimes cd prints something to STDOUT E.g., if your CDPATH has .. To cover this case, use DIR="( cd "( dirname "{BASH_SOURCE[oach w: You probably have CDPATH set to something. If that variable is set in your environment, the cd command will echo the new directory to stdout. Any portable ksh or bash script that uses cd should either redirect its output, or should prefix the cd comma
nd with CDPATck. In this case, 0 is good enough. {BASH_SOURCE[0]} differs from 0 when usin come here to copy this bit i will figure out why people need the 2nd form for linked files... James Andinon: I suggest to add >/dev/null after the cd because the above breaks in odd ways when cd prints something to stdout. Aaron Digulla Nov 4

1 In my experience, it is not necessary to add quotes around () expressions. Thus: FILES=(ls -1) and FILES="(ls -1)" are exactly the same. kevinarpe Nov 24 '13 at 7:19A stupid mistake, but at first I didn't get why {BASH_SOURCE[0]} didn't work until I realized I had used #/bin/sh instead of #/bin/bash. Zitrax Feb 17 at 14:40