Reply to Re: How to do an array?

Your name:

Reply:


Posted by Dave Kelly on 04/08/07 22:59

Chris F.A. Johnson wrote:

>> I need to fill the [] with a number. I had wanted to write a shell script
>> to do that. I have googled for 2 days and have yet to discover how
>> to increment a numerical variable in 'sed'.
>
> Use awk, not sed, e.g.:
>
> awk 'BEGIN { n = 1 }
> { while ( sub(/[[][]]/,"[" n "]" ) ) ++n ; print }
> ' FILENAME > NEWFILE
Thanks Chris.............
Worked beautifully.
--
A little rum in the morning coffee. Just to clear the cobwebs, ya know.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация