I am running a hadoop command and saving the output to a txt file. I just want a specific part of the hadoop command to be in the text file.
#!/bin/sh
hadoop fs -ls /projects/abcd/ | egrep 'delta|snapshot' > /homes/abcd/tools/list_of_feeds.txt
The contents of 'list_of_feeds.txt' -
drwxr-x--- - abcd users 0 2013-02-05 12:16 /projects/abcd/test1_delta
drwxr-x--- - abcd users 0 2013-02-06 00:21 /projects/abcd/test2_snapshot
I just want the contents of the file to be -
test1_delta
test2_snapshot
how do i parse this file or do this in shell?
Thanks
forloop is wacky. What do you expect it to do?