Github user nchammas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4224#discussion_r23698613
  
    --- Diff: ec2/spark-ec2 ---
    @@ -20,6 +20,6 @@
     
     # Preserve the user's CWD so that relative paths are passed correctly to 
     #+ the underlying Python script.
    -SPARK_EC2_DIR="$(dirname $0)"
    +SPARK_EC2_DIR="$(dirname "$0")"
    --- End diff --
    
    `$()` invokes a subshell, so the quotes inside the subshell are processed 
independently of those outside.
    
    So here we're making sure `dirname` gets exactly 1 argument by quoting the 
`$0`, in case the value of `$0` has spaces.
    
    Then, we're making sure the output of `dirname` in turn is captured as 1 
argument when passed to `SPARK_EC2_DIR` by quoting the whole subshell, in case 
that output has spaces.
    
    Welcome to the most deceptive feature of Bash: [Word 
Splitting](http://mywiki.wooledge.org/WordSplitting).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to