25
25
Shell脚本呼应新行到文件
我想在shell脚本中的变量之间呼应一个新行到文件中。这是我的代码。
var1="Hello" var2="World!" logwrite="$var1 [Here's where I want to insert a new line] $var2 echo "$logwrite" \>\> /Users/username/Desktop/user.txt
现在,当我运行我的脚本时,文件user.txt显示如下:
Hello World!
我想让它显示:
Hello World!
我该怎么做?
EDIT: 这是我的shell脚本,我想让它显示:
echo -n "What is your first name? " read first echo -n "What is your last name? " read last echo -n "What is your middle name? " read middle echo -n "What is your birthday? " read birthday echo -e "First Name: $first /nLast Name: $last /nMiddle Name: $middle /nBirthday: $birthday" \>\> /Users/matthewdavies/Desktop/user.txt qlmanage -p "~/Desktop/user.txt"
我怎么做?
0x1&