我正在尝试编写看起来像这样的东西:
#!/bin/bash
echo "type your separated words"
read *all variables*
echo *all variables*
Run Code Online (Sandbox Code Playgroud)
那可能吗?
您可以使用read将它们存储到数组中
read -p $'type your separated words:\n' -a arr
printf "%s\n" "${arr[@]}"
Run Code Online (Sandbox Code Playgroud)