Skip to content

no support for herestrings (<<<) #49

@spikegrobstein

Description

@spikegrobstein

The herestring (<<<) operator in bash is used to pass literal strings/variables into the STDIN of another command. For example. the following two lines are functionally equivalent:

echo "$foo" | grep "x"
grep "x" <<< "$foo"

Trying to parse this with bash-parser results in a parse error:

const ast = parse('grep "x" <<< "$foo"')
Error: Parse error on line 1: Unexpected 'LESS'
    at parse (…/js_bash_ast/node_modules/bash-parser/src/index.js:52:9)
    at fs.readFile (…/js_bash_ast/index.js:14:14)
    at …/js_bash_ast/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

documentation on the herestrings: http://tldp.org/LDP/abs/html/x17837.html

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