Find the answer to your Linux question:
Results 1 to 2 of 2
Hi all, I would like to know how to have graphics embedded using shell scripts... I mean simple =========> or ---------> would do... The main idea here is for every ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    20

    how to get some sort of graphics using shell scripts?

    Hi all,
    I would like to know how to have graphics embedded using shell scripts...
    I mean simple =========>
    or ---------> would do...
    The main idea here is for every element of the bar to move for every % completion of data.....

    I tried echo under a for loop ,but it was not giving me o/p that i could use?

    eg:,
    lets say that i want to install a pkg, a huge one...now for every % of the installation completed i would like to have "===>" ,move one step ahead....

    If this is difficult to incorporate then i woudnt mind having a regular % counting itself (with numericals)

    Thanks

  2. #2
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    Here's an example:

    Code:
    #!/bin/bash
    
    typeset -i _ct
    _ct=0
    _strg=""
    
    while [ $_ct -lt 10 ]
        do
            _ct=_ct+1
            _strg="*${_strg}"
            echo -e "\r${_strg}\c"
            sleep 1
        done
    echo
    Look at the manpage for echo for the explanations of \r & \c.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...