Skip to main content
added 13 characters in body
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265

I'm searching for a possibility to send via pipe several multiline strings to a bash script and grab each of them within this script. Finally i, I want to store each multiline string into its own variable.

printf "$some_multiline_string" "$another_multiline_string" | some_script.sh some_params

printf "$some_multiline_string" "$another_multiline_string" | some_script.sh some_params

IndsideInside of bash:

#!/bin/bash file1=$(</dev/stdin) file2=$(</dev/stdin) ...

#!/bin/bash
file1=$(</dev/stdin)
file2=$(</dev/stdin)
...

How to split stdin into multiple multiline variables?

I'm searching for a possibility to send via pipe several multiline strings to a bash script and grab each of them within this script. Finally i want to store each multiline string into its own variable.

printf "$some_multiline_string" "$another_multiline_string" | some_script.sh some_params

Indside of bash:

#!/bin/bash file1=$(</dev/stdin) file2=$(</dev/stdin) ...

How to split stdin into multiple multiline variables?

I'm searching for a possibility to send via pipe several multiline strings to a bash script and grab each of them within this script. Finally, I want to store each multiline string into its own variable.

printf "$some_multiline_string" "$another_multiline_string" | some_script.sh some_params

Inside of bash:

#!/bin/bash
file1=$(</dev/stdin)
file2=$(</dev/stdin)
...

How to split stdin into multiple multiline variables?

Source Link

Howto split stdin into multiple multiline strings and put each of them into different bash variables

I'm searching for a possibility to send via pipe several multiline strings to a bash script and grab each of them within this script. Finally i want to store each multiline string into its own variable.

printf "$some_multiline_string" "$another_multiline_string" | some_script.sh some_params

Indside of bash:

#!/bin/bash file1=$(</dev/stdin) file2=$(</dev/stdin) ...

How to split stdin into multiple multiline variables?