Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
badboy
on Feb 26, 2012
|
parent
|
context
|
favorite
| on:
Useful use of cat(1)
Ok, I should read more carefully. I thought the article uses
cat > file
followed by ^D to create empty files.
Of course when having some text
cat > file
is just fine.
icebraining
on Feb 26, 2012
[–]
No, you can remove 'cat' on most shells:
> file
LukeShu
on Feb 27, 2012
|
parent
[–]
What shell? I'm running bash 4.2.20(2)-release, and "> file" is behaving like "touch file".
icebraining
on Feb 27, 2012
|
root
|
parent
[–]
You're right, I was mistaken. It's just in Z shell.
salvadors
on Feb 27, 2012
|
root
|
parent
[–]
You mean there are other shells?
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Of course when having some text cat > file is just fine.