ContainerSolutions / minimesos

The experimentation and testing tool for Apache Mesos - NO LONGER MAINTANED!
https://www.minimesos.org
Apache License 2.0
429 stars 61 forks source link

Prevent a partially downloaded script from running. #458

Closed moretea closed 8 years ago

moretea commented 8 years ago

By wrapping the content of the script in '{', '}', sh will not start executing any commands until the closing '}' is encountered.


Proof:

$ cat test1.sh
echo hello world
MISSING STUFF

$ sh test1.sh 
hello world
test1.sh: line 2: MISSING: command not found

$ cat test2.sh 
{
echo hello world
MISSING STUFF

$ sh test2.sh 
test2.sh: line 4: syntax error: unexpected end of file
adam-sandor commented 8 years ago

LGTM

Approved with PullApprove