Commit 77a16d0
committed
fix: fix start script when task contains a single quote
When a task description contains a single quote, the current pattern
`claude "$(cat <<'SIDECAR_PROMPT_EOF' ...` fails with the error:
```
/path/to/start.sh: line 16: unexpected EOF while looking for matching `''
/path/to/start.sh: line 22: syntax error: unexpected end of file
```
Instead, use `read` to read the heredoc into a variable first, then use
the variable when launching the agent.
Before:
```sh
claude "$(cat <<'SIDECAR_PROMPT_EOF'
This single quote causes the bash error: '
SIDECAR_PROMPT_EOF
)"
```
After:
```sh
read -r -d '' sidecar_prompt <<'SIDECAR_PROMPT_EOF'
This single quote is now okay: '
SIDECAR_PROMPT_EOF
claude "$sidecar_prompt"
```1 parent 5809466 commit 77a16d0
1 file changed
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
| 501 | + | |
502 | 502 | | |
503 | 503 | | |
504 | | - | |
| 504 | + | |
505 | 505 | | |
506 | | - | |
| 506 | + | |
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | | - | |
| 511 | + | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
| 514 | + | |
515 | 515 | | |
516 | | - | |
| 516 | + | |
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
530 | | - | |
| 530 | + | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
| 533 | + | |
534 | 534 | | |
535 | | - | |
| 535 | + | |
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
| |||
0 commit comments