i have around 10 lines of code which contains various characters like quotations, exclamation marks, slashes, i want to ask how to add it into file called script.sh using just command line, i mean not any editor liek VIM, but just command from command line?

PS: i found this command to add text into file, but my text has quotations and semicolon.. so this won work..
echo "hello" >> greetings.txt