Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: BASH: How to process files listed in text file?

  1. #11
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: BASH: How to process files listed in text file?

    Quote Originally Posted by Vaphell View Post
    < is better because it is a standard functionality of shell and doesn't require spawning yet another process.
    similar case is with touch - people create empty files with touch because they don't know they can use builtin > file for that (with nothing before >).

    </snip>
    People means me. I had no idea that was possible (and more proper - if you want to say that). Thanks for the tip!

  2. #12
    Join Date
    Sep 2007
    Location
    Oklahoma, USA
    Beans
    2,236
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: BASH: How to process files listed in text file?

    Quote Originally Posted by Vaphell View Post
    < is better because it is a standard functionality of shell and doesn't require spawning yet another process.
    similar case is with touch - people create empty files with touch because they don't know they can use builtin > file for that (with nothing before >).

    Besides, while it doesn't make much difference here, there is plenty of difference between standard functionality that is intended for its purpose and pretty much foolproof, and handmade fugly hacks full of caveats, eg widespread use of for f in `ls` instead of for f in *
    Great points. In addition, for the specific situation at hand, using input redirection will route the data through a FIFO behind the scenes while using "cat" will copy the entire file into RAM thus using much more in the way of resources. If the file in question is only a few K bytes that's no big deal, but if it's a couple of hundred GB then it makes the difference between running at all or crashing spectacularly...
    --
    Jim Kyle in Oklahoma, USA
    Linux Counter #259718
    Howto mark thread: https://wiki.ubuntu.com/UnansweredPo.../SolvedThreads

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •