Sponsored Content
Full Discussion: Want to box the output
Top Forums Shell Programming and Scripting Want to box the output Post 302859335 by drl on Wednesday 2nd of October 2013 10:13:13 PM
Old 10-02-2013
Hi.

A command available on Debian-related systems: boxes
Code:
#!/usr/bin/env bash

# @(#) s1	Demonstrate enclose text within text box, "boxes".

# Utility functions: print-as-echo, print-line-with-visual-space, debug.
# export PATH="/usr/local/bin:/usr/bin:/bin"
pe() { for _i;do printf "%s" "$_i";done; printf "\n"; }
pl() { pe;pe "-----" ;pe "$*"; }
db() { ( printf " db, ";for _i;do printf "%s" "$_i";done;printf "\n" ) >&2 ; }
db() { : ; }
C=$HOME/bin/context && [ -f $C ] && $C boxes

FILE=${1-data1}

pl " Input data file $FILE:"
cat $FILE

pl " Results:"
boxes $FILE

exit 0

producing:
Code:
% ./s1

Environment: LC_ALL = C, LANG = C
(Versions displayed with local utility "version")
OS, ker|rel, machine: Linux, 2.6.26-2-amd64, x86_64
Distribution        : Debian GNU/Linux 5.0.8 (lenny, workstation) 
bash GNU bash 3.2.39
boxes version 1.0.1a

-----
 Input data file data1:
I have on script1 which provide the output text...
I want to make box around that output to make it more beautiful.
As the output lines for the script1 are not fixed, I can not hard
code the design pattern.
Can anyone provide me the code to make design.

-----
 Results:
 +-------------------------------------------------------------------+
 | I have on script1 which provide the output text...                |
 | I want to make box around that output to make it more beautiful.  |
 | As the output lines for the script1 are not fixed, I can not hard |
 | code the design pattern.                                          |
 | Can anyone provide me the code to make design.                    |
 +-------------------------------------------------------------------+

Additional information at Linux / Unix Desktop Fun: Text Mode ASCII-art Box and Comment Drawing

Best wishes ... cheers, drl
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Changing persmissions for output file in UNIX box with SQR.

I am trying to change permissions on an output file from an sqr. The file is pushed out into a directory on the unix box. I am using the following code in the sqr to accomplish this. if $OUTPUT <> '' let $unix_call = 'chmod 664 '||$OUTPUT show $unix_call CALL SYSTEM Using... (1 Reply)
Discussion started by: evengetsteven
1 Replies

2. UNIX for Advanced & Expert Users

VPN client (windows Box),and Server (Unix Box)

If I want to access unix box via VPN tunnel,from windows box. What sould I configure on the windows client PC, and what should I enable on the Unix Server box ? I am using Solaris V10 intel platform, and I am using windows XP, and 2003 for client (0 Replies)
Discussion started by: zillah
0 Replies

3. Solaris

Need to copy printers from Sol8 box to Sol10 box-No luck so far

I need to copy the printers currently installed on a Sol8 box to a Sol10 box. I tried copying the printers.conf file from the Sol8 box and that worked until I went through the file and changed the server name to that of the Sol10 box. Another post on this forum suggested copying the entire... (1 Reply)
Discussion started by: todis
1 Replies

4. Shell Programming and Scripting

ftp file starting with particular name on Windows box to Unix box using shell script

Hello all ! I'm trying to write a shell script (bash) to ftp a file starting with particular name like "Latest_" that is present on a Windows box to UNIX server. Basically I want to set this script in the cron so that daily the new build that is posted on the Windows box can be downloaded to the... (2 Replies)
Discussion started by: vijayb4u83
2 Replies

5. Web Development

How to copy a selected value of list box into a text box in html form?

hi, i have a list box , a text box and a button in a html form. list box displays some values, when a user selects a value from the list box and press the button. the selected value should be copied to the text box value. can any1 give me a html and javascript code to do this facility. ... (1 Reply)
Discussion started by: Little
1 Replies

6. Red Hat

How to access redhat Linux box graphically from windows box?

Hi I have a linux box and need to access from windows graphically # uname -a Linux pc-l416116 2.6.18-155.el5 #1 SMP Fri Jun 19 17:06:47 EDT 2009 i686 i686 i386 GNU/Linux What components do I need to install on Linux and windows to do that? TIA (6 Replies)
Discussion started by: magnus29
6 Replies

7. Shell Programming and Scripting

Notify when the script run(hourly)on my jump-box only when there is a failure on my remote-box

Team, Presently I have a script, which i have set up cron on one of my Jump-boxes,and gives me the output on every hourly basis,fetching the data from the remote machine.Basically it gives me the list of all active users logged and its count once we execute the script.Here the count is... (6 Replies)
Discussion started by: whizkidash
6 Replies

8. How to Post in the The UNIX and Linux Forums

Copying , renaming the file from windox box and ftp to Linux box

Hello my dear friends, Two file are auto generated from mon - fri at different directories on same windows box.Every day i have to copy the file, rename it (specific name)and ftp it to linux box specified directory. is it possible to automate this process,If yes this has to be done from windows... (1 Reply)
Discussion started by: umesh yadav
1 Replies

9. Shell Programming and Scripting

Redirecting stdout output to whiptail menu box

As a result of whiptail menu option I am getting a data from a file. Naturally it is output to terminal as stdour. I like to redirect the output back to the menu. It can be done with single input of line of text , see attached. I just cannot see where or how the sample... (0 Replies)
Discussion started by: annacreek
0 Replies
DwtListBoxSetPos(3Dwt)													    DwtListBoxSetPos(3Dwt)

Name
       DwtListBoxSetPos  -  Makes a specified position (item number in the list) the top visible position in a list box, or as close to the top as
       possible.

Syntax
       void DwtListBoxSetPos(widget, position)
	    Widget widget;
	    int position;

Arguments
       widget	 Specifies the ID of the list box widget whose specified item number in the list you want displayed in the top position.

       position  Specifies the item number in the list displayed in the top position in the list box.

Description
       The DwtListBoxSetPos function makes the specified position (the item number in the list) the top visible position in a list box.  The func-
       tion  determines  which	item in the list box is displayed at the top of the list box, the choice of which is limited by the DwtNitemsCount
       and DwtNvisibleItemsCount attributes to the list box widget.  When DwtNvisibleItemsCount is greater than 1 and  less  than  DwtNitemsCount,
       the list box widget fills the list box with the maximum visible items regardless of the position value.

       For  example,  if  DwtNitemsCount  is  10  and  DwtNvisibleItemsCount is 5, you cannot make item 8 be displayed at the top of the list box.
       Instead, items 6 through 10 would be displayed.	Setting position to 4 would make items 4 through 8 be displayed.  If DwtNvisibleItemsCount
       is 1, you can make any item in the list be displayed at the top of the list box.

See Also
       Guide to the XUI Toolkit: C Language Binding
       Guide to the XUI Toolkit Intrinsics: C Language Binding

															    DwtListBoxSetPos(3Dwt)
All times are GMT -4. The time now is 07:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy