![]() |
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 |
| 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 |
| read user input from within a wile loop that is being fed from below | broli | UNIX for Dummies Questions & Answers | 2 | 01-09-2008 03:19 PM |
| ls while read loop - internal read picking up wrong input | dkieran | Shell Programming and Scripting | 2 | 05-14-2007 03:02 PM |
| how to get input from file | ajaya | Shell Programming and Scripting | 1 | 04-05-2006 02:02 PM |
| input inside while read loop | jhansrod | Shell Programming and Scripting | 3 | 08-13-2005 10:46 AM |
| TCSH.need help.take input during a while/end loop | seg | Shell Programming and Scripting | 1 | 08-28-2003 03:41 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
need help with using input file in the while loop
here's my code:
ls -lt | /usr/bin/egrep `date +"%Y%m%d(05|06|07|08|09|10|11|12|13|14|15|16|17|18|19)"` | \ /usr/bin/egrep -i .dat | /usr/bin/awk '{print $9}' > $LockboxFile1 if [[ -s $LockboxFile1]] then echo " " echo "Files in the archived directory: " cat $LockboxFile1 | while read line do grep -l CHK $line >> $LockboxFile2 done fi it's erroring out, would anyone know why it's not working? |
|
||||
|
tried this one too
ls -lt | /usr/bin/egrep `date +"%Y%m%d(05|06|07|08|09|10|11|12|13|14|15|16|17|18|19)"` | \
/usr/bin/egrep -i .dat | /usr/bin/awk '{print $9}' > $LockboxFile1 cat $LockboxFile1 | while read line do grep -l CHK $line done >> $LockboxFile2 it's giving me an error: done unexpected cat $LockboxFile1 | while read line do grep -l CHK $line : done >> $LockboxFile2 it's giving me an error: done unexpected -- but i tried to run this in unix and it returned the output I am expecting, it's just not working when i add and run in the ksh script i am working on |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|