fork(1) download
  1. #!/bin/bash
  2. s="word1 word2 hello world"
  3. sed -E 's/[^[:space:]]+/"&"/g' <<< "$s"
  4. # => "word1" "word2" "hello" "world"
  5. sed 's/[^[:space:]]*/"&"/g' <<< "$s"
  6. # => "word1" "word2" "hello" "world"
Success #stdin #stdout 0.01s 5516KB
stdin
Standard input is empty
stdout
"word1" "word2" "hello" "world"
"word1" "word2" "hello" "world"