How To Format The Command Output Like MySQL Output

Home » CentOS » How To Format The Command Output Like MySQL Output
CentOS 6 Comments

Hello everylinuxers:

I am now focusing on the development of a script interpretor (some thing like shell)
in embedded environment, and its functions mainly output the data in specified address. In order to make it seems better, I want to format the output result like MySQL output listed below for example

||+——–+————-+
| address| value |
+——–+————-+|
| 0x1110| 0x01 |
+——–+————-+
| 0x1111 | 0x00 |
+——–+————-+|

I think it seems good like this, but I do not know how to make out it.(someone says awk, sed may help, but the environment does not permit it). Is there some libs or tools can help make output result good and elegent?

Sorry to borther all of you, any info would be appreciated.

6 thoughts on - How To Format The Command Output Like MySQL Output

  • 于 2013-10-20 9:59, Mark LaPierre 写道:
    no, embeded environment, a lot of things are extremely striped. I am wondering whether should I write it on my own side.


    /Thanks & Best Regrads! /

    /Nicol TAO (taozhijiang)/

    /Shenzhen, Guangdong Province, P.R. China 518055 /

    /Being Stronger!!!/

  • What tools do you have available in your environment? You have no awk or sed. How about a text editor? Do you have vi or vim? Both of those are based on the ed editor. You might have the ed editor.


    _
    °v°
    /(_)\
    ^ ^ Mark LaPierre Registered Linux user No #267004
    https://linuxcounter.net/
    ****

  • 于 2013-10-20 10:12, Mark LaPierre 写道:
    No editor avaiable. Tell you the trueth, my program runs on the Router, so a lot of things are not available by default. I think if there is no C lib whic can provide this, the only possible way is to write it by myself.


    /Thanks & Best Regrads! /

    /Nicol TAO (taozhijiang)/

    /Shenzhen, Guangdong Province, P.R. China 518055 /

    /Being Stronger!!!/

  • So you have no C lib on the router. What tools do you have available to write a tool with? Can you write and cross compile something for this environment on another computer and then load it onto the router?


    _
    °v°
    /(_)\
    ^ ^ Mark LaPierre Registered Linux user No #267004
    https://linuxcounter.net/
    ****

  • 于 2013-10-20 10:24, Mark LaPierre 写道:
    what I mead C lib, is the tool written in C. I used mips-linux-gnu-gcc, of cause general C lib is available. You count it by mistake ;)


    /Thanks & Best Regrads! /

    /Nicol TAO (taozhijiang)/

    /Shenzhen, Guangdong Province, P.R. China 518055 /

    /Being Stronger!!!/

LEAVE A COMMENT