The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 12-06-2005
ssray23 ssray23 is offline
Registered User
 

Join Date: Dec 2005
Posts: 2
Indent output of an UNIX command

Hi,

How do I indent 4 spaces for standard UNIX commands like ls -ltr (or grep)?
For example, I want ls -ltra to output as:

<<spaces here>>-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file1
<<spaces here>>-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file2
<<spaces here>>-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file3

instead of:

-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file1
-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file2
-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file3



I tried to do it with a functions which indents it's argument, but it did only for the last line of the output.

Any clues?

Thanks in Advance,
Suddha Satta Ray
Reply With Quote
Forum Sponsor