我想打印域後可變分配到另一個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