Sponsored Content
Full Discussion: Tables and borders
Top Forums Shell Programming and Scripting Tables and borders Post 302296310 by flakblas on Tuesday 10th of March 2009 10:18:55 PM
Old 03-10-2009
Just my 2 cents but formatting tables and such around this output would best be done in Perl or Python where it would only add a few lines more. In BASH this could almost double your script size I think since to do it *right* you'll want to write some functions to calculate lengths and draw lines and such. For instance in Perl to print a "line" you can just do
Code:
print "-" x 5

and that will output
Code:
-----

. In BASH you'd have to do
Code:
for ((i=0;i<5;i++)); do echo -n '-'; done

And that's just the tip of the iceberg. Good luck though. I empathize with the BASH addiction.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Routing tables

Hey guys, I needed to add a route to my routing table and I got it to work but on reboot it gets removed. Anyone know what file I can add this route to so it stays on the machine after a reboot? (9 Replies)
Discussion started by: kingdbag
9 Replies

2. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies

3. Shell Programming and Scripting

tables in scripts

Hi , I have two tables with same length t1 and t2, I want to cretae a new third table where i put the difference between the elements of t2 and t1, t3= t1 - t2 t3= t1 - t2 I am new to scripts, any help please? thanks (7 Replies)
Discussion started by: Celine19
7 Replies

4. Programming

How to render solid borders in NCURSES windows

Hello All Gr8 Linux Developers Out There, Background ========= I have created a ncurses application that is suppose to run only on the Linux's virtual console. This application will heavily utilize the ncurses windows to show window-based UI to the user. I am using CentOS5.x. The terminal for... (7 Replies)
Discussion started by: ku@ntum
7 Replies

5. Programming

C++ Dictionaries and tables

I was looking at this code from a programming book: #include <time.h> #include <iostream> #include <string> #include <deque> #include <map> #include <vector> #include <cstdlib> using namespace std; const int NPREF = 2; const char NONWORD = "\n"; // cannot appear as real line: we... (1 Reply)
Discussion started by: totoro125
1 Replies

6. Shell Programming and Scripting

Comparing two tables

I have defined a set of global variables at the beginning of my script as below: #ideal values export ITEM1=SUCCESS export ITEM2=FAILURE export ITEM3=UNAVAILABLE export ITEM5=FAILURE export ITEM6=SUCCESS now I have a shell script function which returns a value in below format. ITEM1... (1 Reply)
Discussion started by: ctrld
1 Replies

7. Shell Programming and Scripting

Compare with 2 tables

I have 3 file inputs, file1 20160302|5485368299953|96|510101223440252|USA|5485368299953|6|800|2300|0 20160530|5481379883742|7|510101242850814|USA|5481379883742|5|540|2181|1500 20160513|5481279653404|24|510100412142433|INDIA|5481279653404|3|380|1900|0... (1 Reply)
Discussion started by: radius
1 Replies

8. Shell Programming and Scripting

Help needed in sending file content with colors and borders

HI i am running a shell script in cron and storing the output of that script in a file say test.then i am copying the content of test to test1 and i will send the output of test to some email ids using mutt. Next time when the script executes i am comparing the contents of test and test1 and... (3 Replies)
Discussion started by: venkitesh
3 Replies

9. Web Development

Getting Rid of Annoying Bootstrap Table Borders and Wayward Table Lines

Bootstrap is great; but we have had some issues with Bootstrapped <tables> (and legacy <fieldset> elements) showing annoying, wayward lines. I solved that problem today with this simple jQuery in the footer: <script> $(function(){ $('tr, td, fieldset,... (0 Replies)
Discussion started by: Neo
0 Replies
cat(1)							      General Commands Manual							    cat(1)

Name
       cat - concatenate and print data

Syntax
       cat [ -b ] [ -e ] [ -n ] [ -s ] [ -t ] [ -u ] [ -v ] file...

Description
       The  command reads each file in sequence and displays it on the standard output.  Therefore, to display the file on the standard output you
       type:
       cat file
       To concatenate two files and place the result on the third you type:
       cat file1 file2 > file3
       To concatenate two files and append them to a third you type:
       cat file1 file2 >> file3
       If no input file is given, or if a minus sign (-) is encountered as an argument, reads from the standard input file.  Output is buffered in
       1024-byte blocks unless the standard output is a terminal, in which case it is line buffered.  The utility supports the processing of 8-bit
       characters.

Options
       -b   Ignores blank lines and precedes each output line with its line number.

       -e   Displays a dollar sign ($) at the end of each output line.

       -n   Precedes all output lines (including blank lines) with line numbers.

       -s   Squeezes adjacent blank lines from output and single spaces output.

       -t   Displays non-printing characters (including tabs) in output.  In addition to those representations used with the -v  option,  all  tab
	    characters are displayed as ^I.

       -u   Unbuffers output.

       -v   Displays  non-printing  characters (excluding tabs and newline) as the ^x.	If the character is in the range octal 0177 to octal 0241,
	    it is displayed as M-x. The delete character (octal 0177) displays as ^?.  For example, is displayed as ^X.

See Also
       cp(1), ex(1), more(1), pr(1), tail(1)

																	    cat(1)
All times are GMT -4. The time now is 08:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy