+ Reply to Thread
Results 1 to 4 of 4

Thread: Piping on Linux Command line

  1. #1
    simonthecat's Avatar
    simonthecat is offline x10Hosting Member simonthecat is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    56

    Piping on Linux Command line

    I was playing with piping in linux and came up with this:
    Code:
    echo $PATH | tr ;  “ “
    Now I want to pass that to the ls -l command so I tried this:
    Code:
    echo $PATH | tr ;  “ “ | ls -l
    But that just lists the current working directory.

    Any ideas on why this did not work?
    Last edited by simonthecat; 04-20-2010 at 06:01 PM.

  2. #2
    slacker3 is offline x10 Sophmore slacker3 is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    146

    Wink Re: Piping on Linux Command line


  3. #3
    simonthecat's Avatar
    simonthecat is offline x10Hosting Member simonthecat is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    56

    Re: Piping on Linux Command line

    Hey that worked! Thank you very much slacker3!

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,502

    Re: Piping on Linux Command line

    Alternatively,
    Code:
    echo $PATH | tr : ' ' | xargs ls -l
    or, more appropriately,
    Code:
    echo $PATH | sed -E -e 's/\s/\\&/' -e 's/:/ /' | xargs ls -l
    in case there are spaces in any of the paths.
    Last edited by misson; 05-06-2010 at 08:40 AM.

+ Reply to Thread

Similar Threads

  1. Linux Command Line and Permissions Question
    By simonthecat in forum Computers & Technology
    Replies: 5
    Last Post: 03-26-2010, 01:36 PM
  2. SQL Command Line
    By gavicus in forum Programming Help
    Replies: 3
    Last Post: 07-04-2009, 12:00 PM
  3. Command line?
    By shaiaqua in forum Free Hosting
    Replies: 2
    Last Post: 05-09-2008, 10:10 PM
  4. log into sql from command line?
    By chess314 in forum Scripts & 3rd Party Apps
    Replies: 6
    Last Post: 01-30-2008, 03:01 AM
  5. command line use
    By estado3 in forum Free Hosting
    Replies: 1
    Last Post: 07-09-2007, 09:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers