Find the answer to your Linux question:
Results 1 to 3 of 3
i have used the code: echo -e "columnName \t columnName \t columnName \t" but when i try to put a ls command into two columns, the output is overlapped and ...
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    13

    Present information in a formatted table

    i have used the code:

    echo -e "columnName \t columnName \t columnName \t"

    but when i try to put a ls command into two columns, the output is overlapped and does not stick to its own column

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by eeezeepeezee View Post
    i have used the code:

    echo -e "columnName \t columnName \t columnName \t"

    but when i try to put a ls command into two columns, the output is overlapped and does not stick to its own column
    That depends on what do you exactly want. But if you need exact cursor positioning, you should look into ANSI scape sequences. For example:

    Code:
    echo -n -e "column1\033[1;0Hcolumn2\033[1;0Hcolumn3"

  3. #3
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Easiest way to get exact column positioning is to use the shell's (bash of ksh) printf formatted output.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...