Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

pipe multi-line string into file

# possibility 1:
echo "line 1" | sudo tee -a greetings.txt > /dev/null

# possibility 3:
sudo tee -a greetings.txt > /dev/null <<EOT
line 1
line 2
EOT
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #pipe #string #file
ADD COMMENT
Topic
Name
2+5 =