bash

Receiving stdin (Standard Input) in Bash

This article introduces how to receive stdin (standard input) in Bash, the command-line language of Linux.

Shou Arisaka
1 min read
Oct 4, 2025

This article introduces how to receive stdin (standard input) in Bash, the command-line language of Linux.

Do it as follows:

myVar=$(</dev/stdin)
echo $(</dev/stdin)

Share this article

Shou Arisaka Oct 4, 2025

๐Ÿ”— Copy Links