Unix Shell - Re: can anyone see the error in this script please I am BASHing my

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > March 2006 > Re: can anyone see the error in this script please I am BASHing my





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: can anyone see the error in this script please I am BASHing my
Janis Papanagnou

2006-03-11, 5:51 pm

Mike wrote:
> can anyone see the error in this script please I am BASHing my head LOL
>
>
> while read line
> do # For as many lines as the input file has...
> $tmp=${line:0:1}
> if [$tmp -ne $comma]; # if tmp is not a , then
> then
> $getdate=${line:0:9}
> $theday=`date +%A -d $getdate`
> $theLine=$theday "-" $thecount "," ${line:10:20}
> else
> $theLine=$line
> fi
> echo $theLine >> testoutput.txt
> done < testtides.csv
> exit
>


Assign to var and not to $var.

tmp=${line:0:1}
getdate=${line:0:9}
theday=`date +%A -d $getdate`
theLine=$line

etc.

Janis
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com