Sponsored Content
Full Discussion: How to center output
Top Forums Shell Programming and Scripting How to center output Post 302692739 by Don_Bilbo on Tuesday 28th of August 2012 05:03:05 AM
Old 08-28-2012
input: 12 rows and 100 balls
Code:
galton.sh 12 100

   ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
   1   2   5   8  13  19   9  16  12   4   5   4   1
  |___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
                                          |   |

and it should look like this:

Code:
   ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
                    1   2   5   8  13  19   9  16  12   4   5   4   1
  |___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
                                          |   |

 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using printf to center

I created a c-shell script to make a mysql report (I'm new to both scripting and mysql) and I want it to look good so I want to center my header. I am guessing printf is the way to go but I cant figure how. I'd appreciate if somehow would let me know if there is a way to do this. Thanks (2 Replies)
Discussion started by: CSGUY
2 Replies

2. Shell Programming and Scripting

Trying to center my output text

Im stumped on how to center the output of my echo command. I also would like to center my calender too, but is the command to center the same for echo and cal? (3 Replies)
Discussion started by: bri4nd4h3r0
3 Replies

3. Solaris

Sun Management Center 4.0

I need to create a managed job to monitor disk space on /tmp for db servers. How do you create a task in SMC to accomplish this? (1 Reply)
Discussion started by: soupbone38
1 Replies

4. Solaris

Sun Ops Center

Hi, Can anyone share the link to download sun ops centre i have sun partner account, but i unable find the link Thanks RJS (3 Replies)
Discussion started by: rajasekg
3 Replies

5. Shell Programming and Scripting

Center output of 'cal' command in terminal

I have a function to center output in a terminal. However It only works for variables. I would like to center the output of the command 'cal' or 'cal -3' in a terminal. I have tried: center `cal` CAL=`cal`; center $CAL cal > cal.txt; center `cat cal.txt` center "`exec cal`" To no avail,... (10 Replies)
Discussion started by: AlphaLexman
10 Replies

6. Solaris

Ops Center AI wrong IP

Hello, I have problems with Automated Installer on Solaris 11. I tried provision Solaris 11 on my T5-1B server from Ops Center, but AI set wrong IP address for manifest SMF. My Ops Center server has two IP addresses 10.236.102.219 and 10.226.21.141. Second IP is in subnet for provisioning of... (25 Replies)
Discussion started by: olibertu
25 Replies
NETSNMP_TRAP_API(3)						     Net-SNMP						       NETSNMP_TRAP_API(3)

NAME
send_easy_trap, send_trap_vars, send_v2trap - send TRAPs or INFORMs from a Net-SNMP MIB module SYNOPSIS
#include <net-snmp/agent/agent_trap.h> void send_easy_trap(int trap, int specific); void send_trap_vars(int trap, int specific, struct variable_list *vars); void send_v2trap(struct variable_list *vars); DESCRIPTION
These three routines may be used to send traps from a MIB module within the Net-SNMP agent (including an AgentX subagent). send_easy_trap() sends an SNMPv1 trap (or the SNMPv2 equivalent) to the list of configured trap destinations (or "sinks"), using the pro- vided values for the generic trap type, and specific trap value. send_trap_vars() is similar, but appends the supplied list of variable bindings to the traps that are sent. send_v2trap() uses the supplied list of variable bindings to form an SNMPv2 trap, which is sent to SNMPv2-capable sinks on the configured list. An equivalent INFORM is sent to the configuredq list of inform sinks. Sinks that can only handle SNMPv1 traps are skipped. The various "send_trap()" calls allow you to specify traps in different formats. And the various "trapsink" directives allow you to spec- ify destinations to receive different formats. But *all* traps are sent to *all* destinations, regardless of how they were specified. I.e. it's ___ trapsink / send_easy_trap ___ [ Trap ] ____ trap2sink ___ [ Generator ] send_v2trap / [ ] ----- informsink ____ trapsess *Not* send_easy_trap -------------------> trapsink send_v2trap -------------------> trap2sink ???? -------------------> informsink ???? -------------------> trapsess WARNINGS
These routines are used to send the traps immediately they are called. Invoking them at the appropriate time is left to the MIB module programmer. SEE ALSO
snmpd.conf(5), snmptrapd(8) V5.6 13 Aug 2010 NETSNMP_TRAP_API(3)
All times are GMT -4. The time now is 09:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy