![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Include PERL script with in the unix shell script | ganapati | UNIX for Dummies Questions & Answers | 1 | 04-29-2008 09:18 AM |
| help me in sending parameters from sqlplus script to unix shell script | Hara | Shell Programming and Scripting | 2 | 01-29-2008 12:31 PM |
| FTP script for sending a file from one unix directory to another unix server director | raja_1234 | Shell Programming and Scripting | 1 | 11-30-2006 04:57 AM |
| how to convert unix .ksh script to windows .batch script | 2.5lt V8 | Shell Programming and Scripting | 1 | 11-28-2006 09:52 AM |
| check in unix shell script so that no one is able to run the script manually | adi_bang76 | Shell Programming and Scripting | 1 | 11-16-2006 07:43 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
don't know how to implentment as unix sh script
for each file if file name like xx*
for each line in a file if substring(3,6) found in another txt file[ the file just have 1 column but have multiple line] output to file-a( filename = orginal file + _a) else output to file-b( filename = orginal file + _a) end Next Line |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Assuming you can use bash
Quote:
Quote:
Quote:
|
|
#3
|
|||
|
|||
|
don't know what happen
I am new for sh script , i have write some code but cann't compile , please help for seeing what problem? It seem to cannot read another file in awk and I don't confirm....
"XXXX.wip.sh" 24 lines, 471 characters >findcust.wip.sh Syntax Error The source line is 7. The error context is while >>> read <<< line awk: 0602-502 The statement cannot be correctly parsed. The source line is 7. Syntax Error The source line is 8. awk -v ' BEGIN {FOUND = "N";} {if (match($0, /\!\$....../)) {checkno = substr($0,3,6); FOUNDINCUST = "N" ; while read line do {if (FOUNDINCUST="N") && (checkno == $line) FOUND = "Y"; FOUNDINCUST ="Y"; print $0 ; } done < "custfilelist.dat" ; } } {if (match($0, "%%RECORDEND")) FOUND = "N";} {if (FOUND =="Y") print $0 >> "atest.dat" ;} {if (FOUND =="N") print $0 >> "btest.dat" ;} ' $SOURCEFILE/TEST*.dat |
|
#4
|
||||
|
||||
|
You're mixing awk with sh.
|
|
#5
|
|||
|
|||
|
thanks for your reply , it means that I cann't have sh script inside the awk call ? then what should I do to do the objective , should i just use the sh script , not use the awk to do it , any code sample that is doing similar things ??
|
|||
| Google The UNIX and Linux Forums |