How to write the following to a file
printf "*\n!.gitignore\n" > $datadir/.gitignore
-bash: !.gitignore\n: event not found
How to write the following to a file
printf "*\n!.gitignore\n" > $datadir/.gitignore
-bash: !.gitignore\n: event not found
single quotes to avoid the ! being treated specially:
printf '*\n!.gitignore\n' > $datadir/.gitignore