Reputation: 767
I want to write some thing in a file through a shell script but inside the script I don't want to use the echo
command to write in file.
Are there other ways to write in a file without using echo
command?
Upvotes: 1
Views: 3191
Reputation: 798606
Lots.
printf "foo" > somefile
cat > somefile << EOF
foo
EOF
bash allows:
cat > somefile <<< "foo"
Upvotes: 3