![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| read some lines from file!!! | andy2000 | Shell Programming and Scripting | 7 | 03-28-2007 04:55 AM |
| Read lines from file | sagolo | UNIX for Dummies Questions & Answers | 2 | 11-27-2006 03:14 AM |
| How to read lines from a flat file | bihani4u | Shell Programming and Scripting | 2 | 09-28-2006 01:54 PM |
| Read the lines from the file in batch | amitraorane | Shell Programming and Scripting | 2 | 01-26-2006 01:51 PM |
| How to read specific lines in a bulk file using C file Programming | rajan_ka1 | High Level Programming | 10 | 11-10-2005 03:29 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
how to read lines one by one from a file
I have one file in which some commands have written line line
i have to read lines from this file(file name passed as avariable) and then i have to execute these commands.. how can i do it? |
|
||||
|
i have written this script for create mqsc command which are stored in {Outfile}.now i have to run these commands.
iam passing two file in this function. function CreateAlterFile { #Eliminate Comments and blanklines grep -vE "^[ ]*#|^ *$" ${1} | while read CHAN TYPE do echo "STOP "${CHAN} >>${OUTFILE}; echo "ALTER "${CHAN}" "${TYPE} "CONNAME("${2}")" >> ${OUTFILE}; done; } Now after this i have to run commands stored in {outfile} how can i do it |
|
||||
|
pls help me out
i tried that..but ihave to execute each line..
by using a loop what iwas trying is grep -vE "^[ ]*#|^ *$" ${1} | (${1} is the file name) while read something (that idont know what to do to get full line) do echo "something" |runmqsc qmgr; done; pls help me out what shd i use for read full line from file |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|