Skip to content

Bash-special characters in program arguments are not escaped #5

Description

@Nindaleth

Hi, thanks for making this. Nimcr is something that I use in probably all of my Nim sources.

I'm writing a tool to parse and sort some text data and it's similar to CSV, only it's separated by | pipes (and sometimes other characters), so I've made the column separator a parameter.

Giving the pipe symbol to the script doesn't really work, though, although it's quoted:

# running via nimcr, pipe unescaped - this may be a bug in how nimcr handles the params
$ ./sort.nim -d '|' -f 9 --mergeOutputs
sh: -f: command not found
SIGPIPE: Pipe closed.

# running via nimcr, pipe escaped - works at the moment
$ ./sort.nim -d '\|' -f 9 --mergeOutputs 
[OK]

# running the resulting binary, pipe unescaped
$ ./.sort -d '|' -f 9 --mergeOutputs
[OK]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions