Results 1 to 2 of 2

Thread: BASH:  run command over long list, appnd 2 file

Hybrid View

  1. #1
    Senior Member
    Join Date
    Apr 2002
    Posts
    417

    BASH:  run command over long list, appnd 2 file

    Hi,

    Im very new to bash scripting. I'd like some pointers on how to do this....

    If I had a list say of users from a file and I wanted to run finger on each name and append that to a file how could I do this.

    for i in [long list from file] do

    finger $i >> finger_query_file <--how can I put an empty line after each query '\n' ?
    done


    Can anyone show me a good way of doing this thanx

  2. #2

    Re: BASH:  run command over long list, appnd 2 fil

    What you have done looks fine as far as it goes. To get a blank line you can append the output from an echo command (with no text) to the file.
    Example:

    Code:
    for i in `cat myfile`
    do
    finger $i >>finger_query_file
    echo >>finger_query_file
    done

Similar Threads

  1. HELP PLEASE! Long file names problem
    By paulmarcw in forum Windows - General Topics
    Replies: 2
    Last Post: 06-20-2013, 11:06 AM
  2. command in bash script to check if tar is currupt or not
    By expresstom in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 05-15-2011, 09:07 PM
  3. W Explorer can't handle long file names
    By paulmarcw in forum Windows - General Topics
    Replies: 8
    Last Post: 02-18-2006, 05:47 AM
  4. Bash :: Command recursion to a directories' contents
    By Schotty in forum Linux - Software, Applications & Programming
    Replies: 7
    Last Post: 01-27-2003, 07:31 PM
  5. bash command for 'ipconfig' equivalent?
    By Phaete in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 05-26-2002, 05:58 AM

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
  •