Re: error in script

2008-09-05 Thread Daniel Burrows
On Fri, Sep 05, 2008 at 11:59:46AM +0200, Jochen Schulz <[EMAIL PROTECTED]> was heard to say: > L.V.Gandhi: > > On Fri, Sep 5, 2008 at 2:42 PM, Jochen Schulz <[EMAIL PROTECTED]> wrote: > > > >>> cat ~/stock/flstock.csv |cut -s -d, -f2|sort >> ~/stock/fliquidstocks.txt > >> > >> Useless use of ca

Re: error in script

2008-09-05 Thread David A. Parker
L.V.Gandhi wrote: On Fri, Sep 5, 2008 at 8:00 AM, David Parker <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: - Original Message - From: "L.V.Gandhi" <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> Date: Thursday, September 4, 2008 9:

Re: error in script

2008-09-05 Thread L . V . Gandhi
On Fri, Sep 5, 2008 at 3:29 PM, Jochen Schulz <[EMAIL PROTECTED]> wrote: > L.V.Gandhi: > > On Fri, Sep 5, 2008 at 2:42 PM, Jochen Schulz <[EMAIL PROTECTED]> > wrote: > > > >>> cat ~/stock/flstock.csv |cut -s -d, -f2|sort >> > ~/stock/fliquidstocks.txt > >> > >> Useless use of cat. :) > > > > How i

Re: error in script

2008-09-05 Thread Jochen Schulz
L.V.Gandhi: > On Fri, Sep 5, 2008 at 2:42 PM, Jochen Schulz <[EMAIL PROTECTED]> wrote: > >>> cat ~/stock/flstock.csv |cut -s -d, -f2|sort >> ~/stock/fliquidstocks.txt >> >> Useless use of cat. :) > > How it can be done more efficiently, please? Just pass the filename to cut as an argument: cut

Re: error in script

2008-09-05 Thread L . V . Gandhi
On Fri, Sep 5, 2008 at 2:42 PM, Jochen Schulz <[EMAIL PROTECTED]> wrote: > L.V.Gandhi: > > > > #!/bin/bash > > rm -f ~/stock/flstock.csv > > grep FUTSTK ~/stock/today/$1 |grep "25/09/2008"|cut -s -d, -f9|sort -nr > > > temp > > You really shouldn't use "temp" as a name. See 'man mktemp'. > > > i=0

Re: error in script

2008-09-05 Thread Jochen Schulz
L.V.Gandhi: > > #!/bin/bash > rm -f ~/stock/flstock.csv > grep FUTSTK ~/stock/today/$1 |grep "25/09/2008"|cut -s -d, -f9|sort -nr > > temp You really shouldn't use "temp" as a name. See 'man mktemp'. > i=0 > for trv in $(cat temp) > do You could save this use of cat with this idiom: while read

Re: error in script

2008-09-04 Thread David Parker
- Original Message - From: "L.V.Gandhi" <[EMAIL PROTECTED]> Date: Thursday, September 4, 2008 9:50 pm Subject: error in script To: debian-user > I have a script as follows > #!/bin/bash > rm -f ~/stock/flstock.csv > grep FUTSTK ~/stock/today/$1 |grep "25

Re: error in script

2008-09-04 Thread David Parker
- Original Message - From: David Parker <[EMAIL PROTECTED]> Date: Thursday, September 4, 2008 10:30 pm Subject: Re: error in script To: "L.V.Gandhi" <[EMAIL PROTECTED]> Cc: debian-user > Try echoing the value of $i each time through the loop.  I wonder if the

Re: error in script

2008-09-04 Thread Ron Johnson
On 09/04/08 20:50, L.V.Gandhi wrote: I have a script as follows #!/bin/bash rm -f ~/stock/flstock.csv grep FUTSTK ~/stock/today/$1 |grep "25/09/2008"|cut -s -d, -f9|sort -nr > temp i=0 for trv in $(cat temp) do grep $trv ~/stock/today/$1 >> ~/stock/flstock.csv i=$((i+1)) if [ $i -e

error in script

2008-09-04 Thread L . V . Gandhi
I have a script as follows #!/bin/bash rm -f ~/stock/flstock.csv grep FUTSTK ~/stock/today/$1 |grep "25/09/2008"|cut -s -d, -f9|sort -nr > temp i=0 for trv in $(cat temp) do grep $trv ~/stock/today/$1 >> ~/stock/flstock.csv i=$((i+1)) if [ $i -eq 20 ] then exit 0 fi done rm

Re: error in script

2006-01-25 Thread David Jardine
On Wed, Jan 25, 2006 at 11:48:47PM +0200, roach wrote: > On Wednesday 25 January 2006 20:10, Jon Miller wrote: > <...> > > LOCSAV="/usr/local/sop" > > if [ -e $(ls -l $LOCSAV/*.ide) ] > > it comes up with an error, can some lend a hand in fixing this? > > Why make it so complicated? > And what wa

Re: error in script

2006-01-25 Thread roach
On Wednesday 25 January 2006 20:10, Jon Miller wrote: <...> > LOCSAV="/usr/local/sop" > if [ -e $(ls -l $LOCSAV/*.ide) ] > it comes up with an error, can some lend a hand in fixing this? Why make it so complicated? And what was, the exact, error message? What shell are you using? Try: if [ -e $

Re: error in script

2006-01-25 Thread BTP
Check out http://www.tldp.org/LDP/abs/html/ a bash scripting guide that should answer all your questions and show you plenty of examples. You also might want to look up the "find" command in the man pages that might be better suited for your task. On 1/25/06, Jon Miller <[EMAIL PROTECTED]> wrot

error in script

2006-01-25 Thread Jon Miller
Trying to run a test to see if certain files exists in a certain location using the following: # Check files at location LOCSAV="/usr/local/sop" if [ -e $(ls -l $LOCSAV/*.ide) ] it comes up with an error, can some lend a hand in fixing this? Thanks Trying to run a test to see if certain files