[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: error in script



On Fri, Sep 05, 2008 at 11:59:46AM +0200, Jochen Schulz <ml@well-adjusted.de> was heard to say:
> L.V.Gandhi:
> > On Fri, Sep 5, 2008 at 2:42 PM, Jochen Schulz <ml@well-adjusted.de> 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 -s -d, -f2 ~/stock/flstock.csv | sort >> ~/stock/fliquidstocks.txt

  Another solution that eliminates this use of "cat" regardless of
what program you're running is to use a file redirection:

  cut -s -d, -f2 < ~/stock/flstock.csv | sort >> ~/stock/fliquidstocks.txt

  Daniel


Reply to: