我想打印域后可变分配到另一个topLeveldomain变量(example.com)bash的操作
$line = example.com
domain =$line | cut -d. -f 1
topLeveldomain = $line | cut -d. -f 2
然而,当我尝试回声$域,它不会显示所需的值
test.sh: line 4: domain: command not found
test.sh: line 5: topLeveldomain: command not found
请谨慎使用'=' – Djee
之前的空格请参阅:http://www.shellcheck.net/ – Cyrus