Computing.Net > Forums > Unix > quick paste string to file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

quick paste string to file

Reply to Message Icon

Name: Pry001
Date: April 11, 2008 at 13:24:29 Pacific
OS: Sun
CPU/Ram: 1
Comment:

As quick as possible paste text into file ?

I've got only vi editor, but typing [esc] :wq! is to long for some users...

cat < file
[here right mouse click]
for longer (approx 20kB) text it isn't working

Have you got any idea ?



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: April 11, 2008 at 22:22:58 Pacific
Reply:

First, your vi command to save and quit vi is incorrect: It's not :wq! it is just :wq

An alternate way of save and quit in vi is :x

Another method to create a file is this way:

cat > myfile.txt
add lines of text
as many as you want
<control-d>

when you are done press the control-d key combination.

The above example creates a new file called myfile.txt. This appends to the file if it exists:

cat >> myfile.txt
add more
lines of text
<control-d>


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: quick paste string to file

Write to file www.computing.net/answers/unix/write-to-file/2878.html

capturing files sent to printer to files www.computing.net/answers/unix/capturing-files-sent-to-printer-to-files/2747.html

Script to scan files for a string www.computing.net/answers/unix/script-to-scan-files-for-a-string/7532.html