1

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?

1 Answer 1

3

Lots.

printf "foo" > somefile

cat > somefile << EOF
foo
EOF

bash allows:

cat > somefile <<< "foo"
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.