LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-24-2008, 03:16 AM   #1
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Rep: Reputation: 30
piping output of find to vim


hi
how to open a file in vim which had been found using find command.

i tried this it does not worked.
Code:
[babu@localhost thread]$ find . -name qthread.h | vi
Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...
 
Old 07-24-2008, 03:32 AM   #2
jens
Senior Member
 
Registered: May 2004
Location: Belgium
Distribution: Debian, Slackware, Fedora
Posts: 1,239

Rep: Reputation: 178Reputation: 178
Vi is trying to execute something in your example.

Try it like this:
Code:
vi `find whatever`
 
Old 07-24-2008, 03:39 AM   #3
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thank u it works,
i want to do the same using pipe .whats wrong with my command.i am sending the output of left hand side command(find) as the input of right hand side command(vi).
 
Old 07-24-2008, 03:57 AM   #4
jens
Senior Member
 
Registered: May 2004
Location: Belgium
Distribution: Debian, Slackware, Fedora
Posts: 1,239

Rep: Reputation: 178Reputation: 178
Quote:
Originally Posted by babu198649 View Post
thank u it works,
i want to do the same using pipe .whats wrong with my command.i am sending the output of left hand side command(find) as the input of right hand side command(vi).
You can't (well, not just like that).
Vi itself needs to communicate with a terminal, hence the error you got.
 
Old 07-24-2008, 07:25 AM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Tell us what you want to do with the file. As said, vi/vim is an interactive editor. You probably want sed (Stream EDitor).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Piping find or ls with rm commands hugene Linux - Newbie 3 05-01-2008 11:19 AM
Piping output between processes. C. banan Programming 1 11-13-2006 12:25 AM
vim: Piping through multiple external commands tragos Linux - Software 2 03-19-2005 02:09 PM
Piping output to text files corbis_demon Linux - General 3 10-12-2004 04:33 AM
Piping output to a text file joadoor Linux - Newbie 7 04-19-2002 04:50 AM


All times are GMT -5. The time now is 09:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration