![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Performance issue with ftp script. | Shiv@jad | Shell Programming and Scripting | 7 | 07-03-2009 01:01 PM |
| Issue with the shell script | viv1 | Shell Programming and Scripting | 2 | 02-19-2008 12:02 AM |
| SFTP script issue | sdhalepaska | UNIX for Dummies Questions & Answers | 0 | 07-05-2007 02:24 PM |
| Issue in my script | chiru_h | Shell Programming and Scripting | 4 | 09-27-2006 10:27 AM |
| please help ftp script issue | mgirinath | Shell Programming and Scripting | 4 | 04-28-2006 11:33 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Issue with sed in script
I have a loop in a script that is given me an error but, when I do it on the command line it works perfectly. The sed statement has to use the variables from a file so the file is partitioned correctly. I am running on HP:
<Begin error>: + cat /u01/bteam/CNAM/1121/.partition + read line + + echo /^00/p;/^01/p;/^02/p;/^03/p;/^04/p;/^05/p;/^06/p;/^07/p,CWDA + cut -d, -f1 part=/^00/p;/^01/p;/^02/p;/^03/p;/^04/p;/^05/p;/^06/p;/^07/p + + echo /^00/p;/^01/p;/^02/p;/^03/p;/^04/p;/^05/p;/^06/p;/^07/p,CWDA + cut -d, -f2 + date +%m%d outfile=/u01/bteam/CNAM/1121/outgoing/CWDA0414 + sed -n '/^00/p;/^01/p;/^02/p;/^03/p;/^04/p;/^05/p;/^06/p;/^07/p' + 0< /u01/bteam/CNAM/1121/lergtemp/LERGT sed: '/^00/p;/^01/p;/^02/p;/^03/p;/^04/p;/^05/p;/^06/p;/^07/p' is not a recognized function. + sort -y + tr -d \n\r + 1> /u01/bteam/CNAM/1121/outgoing/CWDA0414 + rm /var/tmp/* <End Error> <Begin Code> cat /u01/bteam/CNAM/1121/.partition | while read line do part=`echo $line |cut -d, -f1` outfile=$opath`echo $line | cut -d, -f2``date +%m%d` sed -n "'$part'" < $tempfile | sort -y | tr -d "\n\r" > $outfile rm /var/tmp/* done <End Code> File Contents: /^00/p;/^01/p;/^02/p;/^03/p;/^04/p;/^05/p;/^06/p;/^07/p,CWDA /^08/p;/^09/p;/^10/p;/^11/p;/^12/p;/^13/p;/^14/p;/^15/p,CWDB /^16/p;/^17/p;/^18/p;/^19/p;/^20/p;/^21/p;/^22/p;/^23/p,CWDC /^24/p;/^25/p;/^26/p;/^27/p;/^28/p;/^29/p;/^30/p;/^31/p;/^32/p,CWDD /^33/p;/^34/p;/^35/p;/^36/p;/^37/p;/^38/p;/^39/p;/^40/p,CWDE /^41/p;/^42/p;/^43/p;/^44/p;/^45/p;/^46/p;/^47/p;/^48/p,CWDF /^49/p;/^50/p;/^51/p;/^52/p;/^53/p;/^54/p;/^55/p;/^56/p,CWDG /^57/p;/^58/p;/^59/p;/^60/p;/^61/p;/^62/p;/^63/p;/^64/p;/^65/p,CWDH /^66/p;/^67/p;/^68/p;/^69/p;/^70/p;/^71/p;/^72/p;/^73/p,CWDI /^74/p;/^75/p;/^76/p;/^77/p;/^78/p;/^79/p;/^80/p;/^81/p,CWDJ /^82/p;/^83/p;/^84/p;/^85/p;/^86/p;/^87/p;/^88/p;/^89/p;/^90/p,CWDK /^91/p;/^92/p;/^93/p;/^94/p;/^95/p;/^96/p;/^97/p;/^98/p;/^99/p,CWDL |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|