question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while parsing stream redirection inside dollar-parentheses

See original GitHub issue

Snippet which fails:

function ff () {
    local xxxx="$(<aa)"
    case x in
      * ) echo "blabla"; return 1 ;;
    esac &> foo || { echo "ffff"; return 0; }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Yanpascommented, Oct 18, 2018

According to official docs it is short form of cat command substitution:

https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution

1reaction
Yanpascommented, Oct 18, 2018

it means store the content of a file aa in variable xxxx. Here is example:

function ff () {
    local xxxx="$(<aa)"
    echo "xxxx is $xxxx"
}

echo foo > aa

ff

output is xxxx is foo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Escape dollar sign in string by shell script - bash
As you know, a dollar sign marks a variable. You have to take it into account when you are typing it. You can...
Read more >
Why does my shell script choke on whitespace or other ...
The eval builtin tells the shell to parse the string passed as an argument as if it appeared in the script, so at...
Read more >
about Parsing - PowerShell | Microsoft Learn
PowerShell evaluates the quoted string and passes the value (without quotes) to cmd.exe , which results in an error.
Read more >
Bash Reference Manual - GNU.org
The redirection constructs permit fine-grained control of the input and output of those commands. Moreover, the shell allows control over the ...
Read more >
Advanced Bash-Scripting Guide
Redirecting both stdin and stdout in the same script with exec; 20-4. ... A listing of commands within parentheses starts a subshell.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found