Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have following graphviz script which I wish to convert to a bash script.

#!/bin/bash  
graph=$(cat <<GRAPHEND
graph match { 
    node[style=filled shape=point label= ""];
    size="40.0,40.0";
    fontsize=10.0;
    overlap=false ;
    spline=true; 
    nodesep=4.0;
    "aaa" -- "aab" [penwidth=2.25 color="red" label="4" fontsize=7.0];
} GRAPHEND
)
echo $graph
#neato -Tpng $graph > graph.png

This trial is failing with following error

./high_match.dot: line 2: unexpected EOF while looking for matching `)'
./high_match.dot: line 11: syntax error: unexpected end of file

PS : Line no in second line may not be accurate as I have edited the file here.

share|improve this question
up vote 3 down vote accepted

The GRAPHEND should be on a new line.

#!/bin/bash  
graph=$(cat <<GRAPHEND
graph match { 
    node[style=filled shape=point label= ""];
    size="40.0,40.0";
    fontsize=10.0;
    overlap=false ;
    spline=true; 
    nodesep=4.0;
    "aaa" -- "aab" [penwidth=2.25 color="red" label="4" fontsize=7.0];
}
GRAPHEND
)
echo $graph
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.