Sponsored Content
Top Forums Shell Programming and Scripting Display echo results in three column Post 302395230 by frans on Monday 15th of February 2010 11:32:00 AM
Old 02-15-2010
Something like this (not sure for the indexing)
Code:
# create an aray with the data
while read L
do   
    T[$i]="$L"
    ((i++))
done < components
# display the array
COLS=3
ROWS=$((${#T[@]}/$COLS))
for ((i=0; i<$ROWS; i++))
do
    for ((j=0; i=<$COLS; j++))
    do
        echo -e "\t$i : t${T[$((i+ROWS*j))]}
    done
    echo
done

I'm sure awk could do the job fine...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Display from a variable using echo.

I have a variable that is outputting a lot of space. here has been 45 lines returned ... how can I remove the spaces between the "been and the 45" CODE: fil_len=`wc -l < coshb.txt` if ; then cat coshb.txt | more echo " " echo "There has been ${fil_len} lines... (4 Replies)
Discussion started by: jagannatha
4 Replies

2. Solaris

Top and Prstat display different results for memory

I have a question about the accuracy of prstat. I did a 'prstat -t' and it shows 99% of my memory is occupied by oracle. NPROC USERNAME SIZE RSS MEMORY TIME CPU 194 oracle 343G 340G 99% 86:17.24 56% However, 'top' shows I still have 7762meg of memory free. Memory: 16G real, 7762M... (4 Replies)
Discussion started by: zen03
4 Replies

3. Shell Programming and Scripting

what does echo $$ command display

whats the value stored in $$ (2 Replies)
Discussion started by: suri
2 Replies

4. UNIX for Dummies Questions & Answers

How to display first 7 char of grep results?

My file contains the following: uat2000.aspclient.active=true uat2001.aspclient.active=true uat2002.aspclient.active=true uat2003.aspclient.active=true uat2004.aspclient.active=false uat2005.aspclient.active=false uat2006.aspclient.active=false uat2007.aspclient.active=false... (8 Replies)
Discussion started by: kthatch
8 Replies

5. Shell Programming and Scripting

echo display problem

Hi I am facing a strange problem a=03 echo ${a} the output is 3 But i want to display it is 03 Can you people help me how to display it like 03. Thanks (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

6. Shell Programming and Scripting

Display find results, and pipe to xargs

I have an overnight script which runs across a large directory to repair permissions and ownership. I also have this command output the list of files affected so that cron can email these as a log file. Previously I had the command in the form: find /path/to/files -not -user myname -print -exec... (4 Replies)
Discussion started by: mij
4 Replies

7. Homework & Coursework Questions

Using ls or echo to display a specific output

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: What single command line would you enter to get the following output? 8140 drwxr-xr-x 9 root bin 18 Jan 20... (6 Replies)
Discussion started by: dasboot
6 Replies

8. UNIX and Linux Applications

Display mysql results nicely

Hi, perhaps this is a dumb question. I'm running queries on mysql and I'm getting tabbed results like these: mysql> SELECT * from metrics_status WHERE date = '2012-03-30'; <TABLE... (1 Reply)
Discussion started by: erick_tuk
1 Replies

9. Shell Programming and Scripting

display echo only once

lets say I am printing something out echo "Please enter a valid username" and its being printed out 5 times, is there any way I can limit to only being displayed ONCE. I tried echo -n but that just makes everything fit on one line. Right now it keeps saying Please enter a valid... (5 Replies)
Discussion started by: subway69
5 Replies

10. Shell Programming and Scripting

how to display some special results with AWK

I have a file like this: AAEQGAGNQPQH,,,,160,32,,,, AAGQDYNSPLH,,712,39,,,,,, AAGREGGNTEAF,26,,,,,,,,4 AAGSPQH,,,,8,5,,,, AAKKLGQFYNEQF,4,,6,,,7,,,2 AANSGGRYNEQF,,2747,3120,,,,,, AAQGGVGGELF,,,,5,,12,36,, AAQGLAGYYEQY,,25,13,,,,,, AAQRGNEQF,510,2,,,6,,6,,76 AAQTGENSPLH,,16,16,,,,,, The... (9 Replies)
Discussion started by: xshang
9 Replies
HTML::Lint::HTML4(3pm)					User Contributed Perl Documentation				    HTML::Lint::HTML4(3pm)

	'expectArgsRE' => 'A|FONT',

	'headTagsRE' => 'TITLE|NEXTID|LINK|BASE|META',

	'requiredContext' =>
	{
	'AREA'	   => 'MAP',
	'CAPTION'  => 'TABLE',
	'DD'	   => 'DL',
	'DT'	   => 'DL',
	'FIELDSET' => 'FORM',
	'FRAME'    => 'FRAMESET',
	'INPUT'    => 'FORM',
	'LABEL'    => 'FORM',
	'LEGEND'   => 'FIELDSET',
	'LI'	   => 'DIR|MENU|OL|UL',
	'NOFRAMES' => 'FRAMESET',
	'OPTGROUP' => 'SELECT',
	'OPTION'   => 'SELECT',
	'SELECT'   => 'FORM',
	'TD'	   => 'TR',
	'TEXTAREA' => 'FORM',
	'TH'	   => 'TR',
	'TR'	   => 'TABLE',
	'PARAM'    => 'APPLET|OBJECT',
	},

	'okInHead' =>
		{
			'ISINDEX' => 1,
			'TITLE'   => 1,
			'NEXTID'  => 1,
			'LINK'	  => 1,
			'BASE'	  => 1,
			'META'	  => 1,
			'RANGE'   => 1,
			'STYLE'   => 1,
			'OBJECT'  => 1,
			'!--'	  => 1,
		},

	## elements which cannot be nested
	'nonNest' => 'A|FORM',

	'requiredAttributes' =>
	{
	APPLET	=> 'WIDTH|HEIGHT',
	AREA		=> 'ALT',
	BASE		=> 'HREF',
	BASEFONT	=> 'SIZE',
	BDO		=> 'DIR',
	FORM		=> 'ACTION',
	IMG		=> 'SRC|ALT',
	LINK		=> 'HREF',
	MAP		=> 'NAME',
	NEXTID	=> 'N',
	SELECT	=> 'NAME',
	TEXTAREA	=> 'NAME|ROWS|COLS'
	},

	'attributeFormat' =>
	{
		'ALIGN',	 'BOTTOM|MIDDLE|TOP|LEFT|CENTER|RIGHT|JUSTIFY|'.
				'BLEEDLEFT|BLEEDRIGHT|DECIMAL',
		'ALINK' 	 => 'color',
		'BGCOLOR'	   => 'color',
		'CLEAR',	'LEFT|RIGHT|ALL|NONE',
		'COLOR' 	 => 'color',
		'COLS', 	 'd+|(d*[*%]?,)*s*d*[*%]?',
		'COLSPAN',	   'd+',
		'DIR'		=> 'LTR|RTL',
		'HEIGHT',	   'd+',
		'INDENT',	   'd+',
		'LINK'		=> 'color',
		'MAXLENGTH',   'd+',
		'METHOD',	   'GET|POST',
		'ROWS', 	   'd+|(d*[*%]?,)*s*d*[*%]?',
		'ROWSPAN',	   'd+',
		'SEQNUM',	   'd+',
		'SIZE', 	   '[-+]?d+|d+,d+',
		'SKIP', 	   'd+',
		'TYPE', 	   'CHECKBOX|HIDDEN|IMAGE|PASSWORD|RADIO|RESET|'.
				'SUBMIT|TEXT|[AaIi1]|disc|square|circle|'.
				'FILE|.*',
		'UNITS',	 'PIXELS|EN',
		'VALIGN',	 'TOP|MIDDLE|BOTTOM|BASELINE',
		'VLINK' 	 => 'color',
		'WIDTH',	 'd+%?',
		'WRAP', 	 'OFF|VIRTUAL|PHYSICAL',
		'X',		 'd+',
		'Y',		 'd+'
	},

	'badTextContext' =>
	{
		'HEAD',  'BODY, or TITLE perhaps',
		'UL',	 'LI or LH',
		'OL',	 'LI or LH',
		'DL',	 'DT or DD',
		'TABLE', 'TD or TH',
		'TR',	 'TD or TH'
	},

	'bodyColorAttributes' =>
	[
		qw(BGCOLOR TEXT LINK ALINK VLINK)
	],

       );

NAME
HTML::Lint::HTML4 -- Rules for HTML 4 as used by HTML::Lint. SYNOPSIS
No user serviceable parts inside. Used by HTML::Lint. SEE ALSO
HTML::Lint AUTHOR
Andy Lester "andy at petdance.com" COPYRIGHT
Copyright (c) Andy Lester 2005. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-04-06 HTML::Lint::HTML4(3pm)
All times are GMT -4. The time now is 10:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy