Astro - Amit
Astro - Amit

Reputation: 767

writing in file through shell script without using echo command

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

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798606

Lots.

printf "foo" > somefile

cat > somefile << EOF
foo
EOF

bash allows:

cat > somefile <<< "foo"

Upvotes: 3

Related Questions