Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

pipe multi-line string into file

# possibility 1:
echo "line 1" >> greetings.txt
echo "line 2" >> greetings.txt

# possibility 2:
echo "line 1
line 2" >> greetings.txt

# possibility 3:
cat <<EOT >> greetings.txt
line 1
line 2
EOT
Comment

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
Comment

PREVIOUS NEXT
Code Example
Shell :: Create htpasswd file for nginx (without apache) 
Shell :: grant user root permissions oracle linux 
Shell :: quasar pug 
Shell :: ubuntu stacer review 
Shell :: linux subsystem mount file into windows 
Shell :: grep second match 
Shell :: make diff git as commit 
Shell :: linux search string in source recursively 
Shell :: ssh-keygen not interactive 
Shell :: how to install cs50 library in ubuntu 
Shell :: linux remove non empty directory 
Shell :: How to show date and complete time on the Ubuntu Top Panel 
Shell :: git add everything except 
Shell :: linux find file 
Shell :: cisco encryption command 
Shell :: rmmod: ERROR: Module nvidia_drm is in use 
Shell :: match first word regex 
Shell :: enable vault autocomplete 
Shell :: install python 3.6 cli 
Shell :: `path` for shell provisioner does not exist on the host system: 
Shell :: pacman arch 
Shell :: how to exit vi in linux 
Shell :: unrar ubuntu install 
Shell :: delete history linux range 
Shell :: how to zip a folder in putty 
Shell :: Running a local script on a remote machine (or remote on local) 
Shell :: revert to commit git 
Shell :: spoof commit date 
Shell :: git unstage a file 
Shell :: powershell github 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =