Article 6E3XN Standard Scripts for Linux: Bash Script to List all Files Inside a Directory, Line by Line to Standard Output

Standard Scripts for Linux: Bash Script to List all Files Inside a Directory, Line by Line to Standard Output

by
des_a
from LinuxQuestions.org on (#6E3XN)
I'm now in the process of updating and creating a working set of standard scripts for linux. This is the base, I will build everything else off of. Everything above it, will assume that the standard scripts are installed. They will eventually, want to be cross platform, at least on Windows and Linux. Since I'm focusing now on Linux, as it works better, this will be the first to be finished again. I'm writing here because I'm having some trouble. This is a network specific thing, for my home network. I may use them on other networks as time goes on, but let's start with my network. And then, soon after, I can work on my github page for my network, I hope, so that others can benefit possibly and stuff later, though I may start with making them private on there. We'll see. If I have to make them private, it's just because they contain some specific code identifying my network, which I may or may not want to share.

OK. Let's start with specifics, where I'm having trouble.

The first thing I'm going to want to do, is modify my install script, so that upon installing, as it's last task, it will output a log to its directory it's ran from, which will list in this format:

Code:filename
filename
filename
.....the files it installed, which can be gotten from listing in that format, the files in it's below directory of ./scripts/ all the files in there. Then, in my install file, I'll use that script in that folder, to output the files, line by line, and then I'll redirect it to a text (log) file. I want to include itself in this listing.

This, will then be able to be printed, by sending the text file to a printer, probably for now, at the library, and I will be able to have a checklist once it's on paper, of what's debugged, and what still needs to be debugged, very easily. Then I can come back to you guys and have some help debugging these files. Otherwise, I need a checklist by hand, which is trickier. I am losing time trying to create it by hand.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments