I have an ASCII file containing filepaths which I read by running:
while read p; do echo $p; done < filelist.txt
The file contains filepaths with the following pattern:
./first/example1/path ./second/example1/path ./third/example2/path
How can I get a specific part of the path string (from
/ ), e.g.
I need to get an output that prints:
first second third
example1 example1 example2
I'm sure there is a way of doing this using regular expressions and
sed, but I'm not familiar with it.