Shell script echo nuova linea al file
Voglio fare l'echo di una nuova linea in un file tra le variabili in uno script di shell. Ecco il mio codice:
var1="Hello" var2="World!" logwrite="$var1 [Here's where I want to insert a new line] $var2 echo "$logwrite" \>\> /Users/username/Desktop/user.txt
In questo momento, quando eseguo il mio script, il file user.txt mostra questo:
Hello World!
Voglio che mostri:
Hello World!
Come faccio?
EDIT: Ecco il mio script di 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"