The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
while loop inside while loop panknil Shell Programming and Scripting 0 01-07-2008 09:49 AM
For loop xramm HP-UX 3 10-10-2007 11:20 AM
While Loop hemangjani Shell Programming and Scripting 2 11-02-2006 08:01 AM
for loop munnabhai1 Shell Programming and Scripting 3 04-06-2006 11:30 AM
how to get the similar function in while loop or for loop trynew Shell Programming and Scripting 3 06-17-2002 08:09 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-18-2007
Registered User
 

Join Date: Mar 2007
Posts: 9
while , for loop ?

Hi,
I have a text file (.txt) that contains two lines that each have a number on them.

-----------------
5
6
-----------------

I would like to convert those numbers to either another txt file or html file to show asterics instead.

------------------
*****
******
------------------

Thanks.
Reply With Quote
Forum Sponsor
  #2  
Old 04-18-2007
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,030
Code:
echo '6' | nawk '{for(i=1; i<=$0; i++) printf("%s%s", "*", (i==$0) ? "\n", "")}'
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0