|
Simple Conditional execution in a script: msg#00015editors.sed.user
Friends, We are trying to accomplish a simple conditional exeuction of a statement using sed or perl script, We are trying to read a line from a file and generate a separate set of files based on the lines from that file, In most cases our source file has a number which tells us how many files to create, so we have to read from a file called 07122005.bak, which has just a number '25', we need to generate 07122005_1.bak ..07122005_25.bak We have tried commands like more, head and cat to read the line into a variable so that we could loop that many times, but when we use those commands it is inserting a EOF into the variable value which negates our downstream use of the variable our script looks like cat 07122005.bat > $u echo $u This returns 25 EOF Any suggestions? BTW, we are on a sun box(solaris) ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/dkFolB/TM --------------------------------------------------------------------~-> -- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/sed-users/ <*> To unsubscribe from this group, send an email to: sed-users-unsubscribe@xxxxxxxxxxxxxxx <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Stingily extracting a block of lines: 00015, Angus Leeming |
|---|---|
| Next by Date: | Re: Replacing a pattern in one file by reading a string from anotherfile: 00015, kaushik . m |
| Previous by Thread: | Stingily extracting a block of linesi: 00015, Rachel Cogent |
| Next by Thread: | Re: Simple Conditional execution in a script: 00015, YogS |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |