Linux dpkg Software Report
Ray Parrish
crp at cmc.net
Thu Dec 24 11:02:13 UTC 2009
Tim Frost wrote:
> On Tue, 2009-12-22 at 21:25 -0800, Ray Parrish wrote:
>
>> Hello,
>>
>> I hope I won't get flamed for this, but I have just completed my most
>> ambitious script to date, and have completed the Linux dpkg Software
>> Report script which takes output from dpkg, and formats it into html
>> pages sorted by package section, such as Games, Editors, etc... and also
>> generates an alphabetical index to the packages.
>>
>
> Nice effort.
>
>
> One issue with the script as written is that it MUST be invoked with an
> absolute path name (i.e,
> "/home/tim/bin/SoftwareReport/LinuxdpkgSoftwareReport.sh", rather than
> "LinuxdpkgSoftwareReport.sh" or
> "./bin/SoftwareReport/LinuxdpkgSoftwareReport.sh" - which I tried
> first). This is used to:
> - locate support scripts
> - determine where to write the output files
>
Is /home/tim/bin in your PATH environment variable on your system? If it
is, and you installed the script there, it should run, unless the script
does not have write priveleges in that folder.
I do not know of any way to make the script itself be recognized without
the path name unless it is installed somewhere that is on the PATH
variable's definition. Perhaps you could enlighten me as to a method of
doing this?
> Ideally, the program should be able to locate itself, and then derive
> the location of the support scripts, based on its location.
>
Which it does, it checks it's own name and path to find out where it has
been executed from, and then creates the folder structure it needs, and
creates the report files in those folders where ever it is ran from.
> It should also use the user's preferred temp directory (or /tmp
> or /var/tmp), rather than writing files to a directory under it's
> install location.
>
I was not aware that this could be done without running the script with
sudo, and thought it would be safer for people to have it writing files
into folders they were allowed to write to without administrative
privileges, so it cannot write to administrative areas of the drive
structure.
> This allows an admin to install the scripts in a system directory such
> as /usr/bin, without needing to compromise system security.
>
If I do that do I need to give root permission to execute the script?
And where do I write it's output files to, /tmp again? I actually
prefer to write them to my personal user space, but I would like to be
up to speed on normal practice for Linux, and am rather new to it so I
did not know this was considered to be a requirement.
> I will see what I can do about these issues, and feed the results back.
>
I appreciate that you would like to help, thank you.
>>
>>
>>
>
>
> Tim
>
Thanks again, Ray Parrish
--
The Future of Technology.
http://www.rayslinks.com/The%20Future%20of%20Technology.html
Ray's Links, a variety of links to usefull things, and articles by Ray.
http://www.rayslinks.com
Writings of "The" Schizophrenic, what it's like to be a schizo, and other
things, including my poetry.
http://www.writingsoftheschizophrenic.com
More information about the ubuntu-users
mailing list