Here's my situation:
I want to run a script that creates html pages from my man pages. I already have the tool to do that, and know a little bit about scripting, but not that much. I've read through some tutorials already, and it's difficult to find what i'm looking for.
So far I list the contents of three folders and concatenate them into one file, thus giving me one long list of single words (commands, in this case):
Code:
#!/bin/bash
path1=/bin
path2=/usr/bin
path3=/usr/local/bin
filename=allBinaries.txt
ls -1 ${path1} > ${filename}
ls -1 ${path2} >> ${filename}
ls -1 ${path3} >> ${filename}
I would like to read in each line from ${filename} and store each string (each line - each command) into one spot in an array. I can't seem to figure out how to list
one line of a file with more, less, tail or cat (but i may have overlooked it). Is this even possible? Or even better, would i be able to pipe the output of
ls -l into an array?
Thanks for any feedback.