![Bash 스크립트에서 여러 텍스트 읽기](https://linux55.com/image/30449/Bash%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EC%97%90%EC%84%9C%20%EC%97%AC%EB%9F%AC%20%ED%85%8D%EC%8A%A4%ED%8A%B8%20%EC%9D%BD%EA%B8%B0.png)
graphviz
bash 스크립트로 변환하려는 다음 스크립트가 있습니다 .
#!/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
이 시도는 다음 오류로 인해 실패합니다.
./high_match.dot: line 2: unexpected EOF while looking for matching `)'
./high_match.dot: line 11: syntax error: unexpected end of file
추신: 두 번째 줄의 줄 번호는 제가 그곳에서 파일을 편집했기 때문에 정확하지 않을 수 있습니다.
답변1
GRAPHEND
새 줄에 있어야 합니다 .
#!/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