1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Rep Power

    Bash Shell: cat/cp and cut/awk


    I'm writing a bash shell script which go through a large file and generate a large file.

    Does anyone know which is faster ?

    1. cut VS awk for stripping certain fields.

    2. cat old-file > new-file VS cp old-file new-file.

    Also, can anyone give a general direction on how to write bash shell script that run efficiently ?
    Like what is generall bad things to do...

    I know it is best to use built-in commands for bash but is there any other ?
    How about using many pipes and command substitution using backup quotes ?

    Thanks you.
  2. #2
  3. Introspective
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Nov 2001
    London, UK
    Rep Power
    I keep seeing this post sitting here and I keep wondering how to reply.. but I just keep thinking 'Is there really going to be *any* appreciable difference?' my instincts tell me there isn't.

    This is me: http://chris.uk.com

IMN logo majestic logo threadwatch logo seochat tools logo