binpash / binpash/hs

Issue with Multi-line Command Parsing

Open
#62 0 comments 0 reactions 0 assignees View on GitHub
bug parsing
Dominant language
Shell
Stars
19
Forks
0
PR merge metrics
No merged PRs in 30d

Description

When parsing commands that extend over multiple lines, they're not always parsed as expected.

**To reproduce:**

Consider the following multi-line command:

```bash
sed 's/.*\(.\)\(.\)\2\1.*/p: \1\2-\2\1/;t
g' "$file_1" > "$file_2"
```

Upon transformation, it becomes:

```bash
sed 's/.*\(.\)\(.\)\2\1.*/p: \1\2-\2\1/;t g' "$file_original" > "$file_palindrome"
```

This flattened version of the command throws an error when executed.

**Suggested Solutions:**

1) Retain the multi-line format in the Rikerfile during parsing, preserving the original structure. This will likely solve comment related issues (#60) too.

2) Alternatively, during transformation, replace new lines in commands with `;`. In most scenarios, this should yield the same result (correct me if I am wrong). For example, the following should execute without errors:

```bash
sed 's/.*\(.\)\(.\)\2\1.*/p: \1\2-\2\1/;t;g' "$file_1" > "$file_2"
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.