If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Print something X times depending on a value

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-04, 10:24
TimoV TimoV is offline
Registered User
 
Join Date: Dec 2003
Posts: 56
Print something X times depending on a value

I have created a little script that creates a "visual" overview of df -k in a webbrowser.

To get the "visual" aspect I print an # for every 10% disk usage. Now comes my problem.

What i do atm is:

Code:
echo "##########" > tmp/tmpfile.$$
ZUSAGE=`cat tmp/tmpfile.$$ | cut -c1-$AUSAGE`
Now i want to make the website nicer by using a graphic and printing that X times.... However I had issues with al lthe types of fro and while loops I tried. I'm not sure what i was doing wrong but could someone give me a clue how it would work?

I tried things along the lines of (could be typos/syntax errors below as it I did this a while ago)

Code:
while (x=0;x<$AUSAGE;x++)
do
   print "#"
done
any ideas how it should be done?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On