LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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, 02: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, 02:32 AM   #2
jens
Senior Member
 
Registered: May 2004
Location: Belgium
Distribution: Debian, Slackware, Fedora
Posts: 1,190

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

Try it like this:
Code:
vi `find whatever`
 
Old 07-24-2008, 02: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, 02:57 AM   #4
jens
Senior Member
 
Registered: May 2004
Location: Belgium
Distribution: Debian, Slackware, Fedora
Posts: 1,190

Rep: Reputation: 159Reputation: 159
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, 06:25 AM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,226

Rep: Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022Reputation: 2022
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 10:19 AM
Piping output between processes. C. banan Programming 1 11-12-2006 11:25 PM
vim: Piping through multiple external commands tragos Linux - Software 2 03-19-2005 01:09 PM
Piping output to text files corbis_demon Linux - General 3 10-12-2004 03:33 AM
Piping output to a text file joadoor Linux - Newbie 7 04-19-2002 03:50 AM


All times are GMT -5. The time now is 10:44 PM.

Main Menu
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