![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, i'm writting a krnshell script (sun solaris) that reads data that is entered to it and does an echo or something else, one section at a time. The data being entered would be something like this:
1111 <---- this being the begining of the section of info till it gets to the next saxxxxx saxxxxx saxxxxx <--- this is the end of the section, this will vary like for instance 2's 2222 have only 2 items under it. saxxxx saxxxx quit #!/bin/ksh echo " Line id: " read lid while [ $lid != "quit" ] do echo "$lid" >> file read lid done for x in `grep yyyy file` yyyy <-- are the 4 digit numbers above one at a time do echo "$x" for sn in `grep sa file` do echo "$sn" done done rm file rm file_b exit I think i tried it like this and i get 1111 then all the saxxx's below it. Not the way i need it, 1111 then saxx's below 1111 then 2222 then saxx's below it from the file. I hope this understandable. Any help appreciated. Thanks |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
As near as I can determine the output would be identical to the input and thus you do not need a script. |
||||
| Google The UNIX and Linux Forums |