Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

echo or cat into multiple files

# Use tee to read from standard input and write to standard output and files.
echo "hello" | tee -a file1 file2

or 

# can flip it around for heredoc: 
tee -a aaa bbb ccc << EOF contents ... EOF
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #echo #cat #multiple #files
ADD COMMENT
Topic
Name
3+3 =