![]() |
|
|
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 |
| Array inside an array | manas_ranjan | UNIX for Advanced & Expert Users | 5 | 06-10-2008 03:25 PM |
| array | ccp | Shell Programming and Scripting | 3 | 02-26-2008 03:19 AM |
| I need help with an array! | djsal | Shell Programming and Scripting | 1 | 11-28-2007 11:26 AM |
| create array holding characters from sring then echo array. | rorey_breaker | Shell Programming and Scripting | 5 | 09-28-2007 09:42 AM |
| Do I need an array here? | TheCrunge | Shell Programming and Scripting | 5 | 04-19-2005 04:20 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi Klashxx
How u doing thanks for the answer My script is this #!/usr/bin/ksh DIRNAME=`dirname $0` export columnIdFile="colids.txt" LOGFILE=$DIRNAME/cvs_users_defaults.log TIME=`date` #checks to see if the log files is present, if not then creates it if [ -a $DIRNAME/cvs_users_defaults.log ] then : else touch $DIRNAME/cvs_users_defaults.log fi #Checking to see if a data file(colids.txt) exists for a load. if [ -a $DIRNAME/$columnIdFile ] then INCOLFILE=$columnIdFile; echo "Using file $INCOLFILE as input for column id"; echo " "; echo "Started Process on $TIME" >> $LOGFILE echo "Calling procedure to initialize users" for colId in `cat $INCOLFILE` do echo "Storing User Defaults for User " $colId >> $LOGFILE integer i=0 awk '{print $1}' colids.txt | while read item; do myarray[$i]=$item i=$i+1 done integer j=0 if [[ $j -lt 5 ]]; then print ${myarray[j]} echo "${myarray[${j}]}" j=$j+1 fi done #Here I am trying to print or echo the values in the array myarray but #couldnot get the values #Is there something wrong I am doing Can you plz help me out #rename the file after processing logtime=`date "+%y%m%d%H%M%S"` newUserFile="cvs_users_processed_"$logtime".txt" # mv $userFile $newUserFile echo "Ending process of setting user defaults at $TIME " >> $LOGFILE echo "Check the log file at $LOGFILE" exit 0 else #IF "custsoncologyusers.txt" file does not exist in DIRNAME then end grace fully echo "No user default file ($userFile) is available to load" echo "No user default file ($userFile) is available to load" >> $LOG FILE echo "Ending user default process with a return code 0 at $TIME" >> $LOG FILE exit 0 fi Thanks Pinky |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|