Post Reply 
Linux/Bash help - redirection
Author Message
whjms
EpiCanadian

Posts: 435.1825
Threads: 126
Joined: 23rd Dec 2008
Reputation: 3.37413
E-Pigs: 24.8045
Offline
Post: #1
Linux/Bash help - redirection
I'm having trouble redirecting output to a file. Here's my example: I want to read in an existing file, replace all single newlines with two newlines, and save it. Here's what I've got:

Code:
cat -E documents/file.txt | sed 's/\$/\n/g' > documents/file.txt

However, when I open up file.txt, it's empty. What gives? Do I have to 'close' it, or something like that?

(This post was last modified: 18/01/2013 06:12 AM by whjms.)
18/01/2013 06:10 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Linux/Bash help - redirection - whjms - 18/01/2013 06:10 AM
RE: Linux/Bash help - redirection - Joom - 18/01/2013, 08:13 AM
RE: Linux/Bash help - redirection - whjms - 18/01/2013, 12:28 PM
RE: Linux/Bash help - redirection - lembas - 18/01/2013, 09:49 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: