Skip to content

$variables in exec() aren't handled correctly #11

@jbuck

Description

@jbuck

An example shell script I'm using: lsof -i :80 | grep node | awk '{ printf $2 }'

What this should print out is the PID of the node process running on port 80; instead it returns awk: line 1: no arguments in call to printf. I can recreate this error by deleting the $2 and running it on my terminal. I suspect that shelljs or node is incorrectly escaping or interpolating the $2 variable; I haven't figured out the magical number of slashes to escape it properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions