Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Using cat output in a variable to use next in ls

    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. #2
    Join Date
    Oct 2012
    Location
    Minsk, Belarus
    Posts
    15
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    0
    while read d; do
    echo "Looking in $d";
    look_in("$d");
    done <list_of_one_directory_per_line.txt

 

 

Similar Threads

  1. Replies: 1
    Last Post: 05-17-2012, 12:30 PM
  2. command: cat
    By Rob in forum Linux Commands
    Replies: 8
    Last Post: 05-03-2012, 02:35 PM
  3. Input/output error upong deleting..
    By enhu in forum General Linux
    Replies: 5
    Last Post: 02-19-2012, 12:14 PM

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
  •  
           








Check out Linux Central for Linux software and other goodies!





» Stats

Members: 3,534
Threads: 3,911
Posts: 9,419
Top Poster: Fred (1,486)
Welcome to our newest member, IvanWalker

» Links



Powered by vBadvanced CMPS