💻 Software
newline in bash variable
Fresh5 days ago
Mar 15, 20263311 viewsConfidence Score0%
0%
Problem
My script contains something like this: With this, the variable contains the output of the command but without newlines. So, when I print it with I get only one line. How can I include the newlines of subcommands?
Error Output
ifc=$(ifconfig)
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Canonical Fix
Unverified Fix
New Fix – Awaiting Verification
Fix for: newline in bash variable
Low Risk
The correct way to print is
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix