Find the answer to your Linux question:
Results 1 to 2 of 2
folks. i am writing a simple shell script that prints the number from 100 to 200. But my requriment is that when is should run it, it should not show ...
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    34

    override using echo

    folks. i am writing a simple shell script that prints the number from 100 to 200.

    But my requriment is that when is should run it, it should not show me the output like

    100 101 102 ... 200

    intead i want that it shoud print 100, then override 100 and print 101 then override it and print 103 ... till 200.

    How can we do that using echo


    i am doing

    echo -e -n "$var \r"

    But its giving me nothing in output??

    Any Ideas?

  2. #2
    Linux Guru gogalthorp's Avatar
    Join Date
    Oct 2006
    Location
    West (by God) Virginia
    Posts
    3,105
    1) did you change permissions to +x ??

    2) are you running it by
    sh script
    where script is the name of your script?

    3) you should put a plain echo after the loop so to move to the next line otherwise the prompt will overwrite the output

    4) This will happen very fast chances are you will only see the last number. Are you putting a delay into the loop so you can see the count progress??

Posting Permissions

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