I want to echo a new line to a file in between variables in a shell script. Here's my code:
var1="Hello" var2="World!" logwrite="$var1 [Here's where I want to insert a new line] $var2 echo "$logwrite" >> /Users/username/Desktop/user.txt
Right now, when I run my script, the file user.txt shows this:
Hello World!
I want it to show:
Hello World!
How do I do this??
EDIT: Here's my shell script:
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"
printf "%s\n" $var1 $var2 >> file
?