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
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:
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
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
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
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
- 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
- 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
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
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
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
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 $
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
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
14 matches
Mail list logo