Home
Certification Preparation
CompTIA
Linux+
Create file vs custom end marker
JerryL
I'm just new to learning Linux and I'm trying to find the value in the difference between two ways of creating simple files. The first is in creating a file and the second is with a custom end marker
cat > winter.txt
--- enter text ---
Ctrl d key
and
cat > hot.txt <<stop
> line 1
> line 2
> stop
The above two examples end up with giving the same end result. Other than the syntax, what is the real difference between the two and when would you want to use one over the other?
Thanks from a newbie linuxer!
Find more posts tagged with
Comments
pram
The second is a heredoc, you'd use it for a non interactive script.
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of