write new line in file bash code example
Example 1: echo new line to file
echo $'username=user\npassword=pass' > ~/samba-credentials
Example 2: echo new line in a file bash
echo -e "Line 1\nLine 2"
echo $'username=user\npassword=pass' > ~/samba-credentials
echo -e "Line 1\nLine 2"