Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gsliepen
on July 30, 2021
|
parent
|
context
|
favorite
| on:
Whitespaces and Strings in Bash (2018)
There are better ways to split a string on spaces in Bash than calling external tools. For example, the following will split the line as intended, and put the results in variables:
read name state roles ages version <<< "$result"
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: