LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 11-19-2008, 06:30 AM   #1
dv105v
LQ Newbie
 
Registered: Nov 2008
Location: Bucharest, Romania
Distribution: slackware
Posts: 2

Rep: Reputation: 0
slackware command line pipe-ing issue


Hello All,
I have just installed:
- Slackware running within virtualbox installed on a XP.
- 2.6.24.5-smp #2
Something strange happens when I try to use pipes, i.e.:
# find /root -name "loadlin*" | grep -w "zip" | ls -la
instead of making ls -la on the only resulted file from
find /root -name "loadlin*" | grep -w "zip" which is
/root/loadlin16c.zip
it is actually making ls -la on the entire /root directory and the result is actually the ls -la in the /root directory, I mean all files from /root are actually listed.
This happens for all accounts not only for root.
 
Old 11-19-2008, 07:06 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
This is because "ls" does not accept a parameter from stdin. It wants the input as a commandline parameter.
Better would be:
Code:
find /root -name "loadlin*" -exec ls -la {} \; | grep -w "zip"
Eric
 
Old 11-19-2008, 09:24 AM   #3
dv105v
LQ Newbie
 
Registered: Nov 2008
Location: Bucharest, Romania
Distribution: slackware
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Alien Bob View Post
This is because "ls" does not accept a parameter from stdin. It wants the input as a commandline parameter.
Better would be:
Code:
find /root -name "loadlin*" -exec ls -la {} \; | grep -w "zip"
Eric
Thank you Eric,
 
  


Reply



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
Issue a command line statement from within a C/C++ program? DiBosco Programming 7 05-23-2008 07:34 PM
PHP and JavaScript: problem with echo()-ing unwanted line breaks Robhogg Programming 3 02-12-2007 07:52 AM
How do I install software from the command line on slackware 10.2? v@ny@ Linux - Newbie 8 12-15-2005 03:53 AM
Command-line paranoia: Converting a pipe to stdin asciimonster Linux - General 3 06-28-2004 04:57 AM
when i start slackware i only have a command line, how do i get to kde Longinus Slackware 8 12-13-2003 10:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:47 AM.

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
Open Source Consulting | Domain Registration