Using cat output in a variable to use next in ls

Discussion in 'Command Line' started by clapsym, Oct 31, 2012.

  1. clapsym

    clapsym New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi there.
    I am trying to write a little script to get the information about big files saved in home users directories.
    I have just find the list of directories I need to explore using a little script with cat, but I would like to use the cat output and then explore each one of the directories looking for specific kind of files, the thing is I would like to store the cat output in a variable and then use something with for to do the search in every directory. Someone can give me a clue about how to use the cat output in a variable?
    The cat output has several directories ... it is something like \test\somefiles \test2\anotherone \test3\mixed \notest\resting
    I would like to have this output in an array but I don't know how to send it to an array.

    Any help will be really appreciated.


    Thanks a lot in advance.
  2. old_bolvan

    old_bolvan New Member

    Messages:
    15
    Likes Received:
    3
    Trophy Points:
    3
    while read d; do
    echo "Looking in $d";
    look_in("$d");
    done <list_of_one_directory_per_line.txt

Share This Page