![]() |
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 |
| what is wrong with this tr -d? | cleansing_flame | UNIX for Dummies Questions & Answers | 3 | 02-06-2008 12:34 PM |
| What’s wrong with the following? | vrn | UNIX for Dummies Questions & Answers | 8 | 03-19-2006 09:09 PM |
| where have i gone wrong? | Blip | Shell Programming and Scripting | 3 | 01-28-2004 04:43 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
what is wrong here
Hello,
I have a simple script such as ----------------------------- #! /bin/sh YEAR=`date -u +%Y`; MONTH=`date -u +%m`; DAY=`date -u +%d`; DATE=$MONTH$DAY$YEAR LOGFILES=auditTrail-$DATE LOGMATCH=$LOGFILES\* ARGUM='' # find all files and write them to a file find . -name "$LOGMATCH" > temp cat ./temp | while read file_line do ARGUM=$file_line' '$ARGUM echo $ARGUM done echo "final string contains" echo $ARGUM echo "nothing" ---------------------------- I was hoping that it will read a line one at the time and add to the variable ARGUM. It does exactly that within the loop. Yet, when it gets out the loop, last line echo $ARGUM return nothing output looks like this ./log/auditTrail-02022007.10.out ./log/auditTrail-02022007.14.out ./log/auditTrail-02022007.10.out ./log/auditTrail-02022007.7.out ./log/auditTrail-02022007.14.out ./log/auditTrail-02022007.10.out ./log/auditTrail-02022007.1.out ./log/auditTrail-02022007.7.out ./log/auditTrail-02022007.14.out ./log/auditTrail-02022007.10.out final string contains nothing ----------------------- I thought that variable ARGUM is global everywhere in the script. What am I missing? Thank you in advance |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|