ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: Slackware 11, Solaris 10, Solaris 9, Sourcemage 0.9.6
Posts: 322
Rep:
Reading a conf file from a BASH script
Hi!
I'm a BASH newbie. I have to write a script for a project I'm working on, but I have no BASH book or manual.
Ok, this is my problem:
I want to read a config file I made myself. How do I make BASH read it and execute the commands in it? The file already contains a URL. Do I have to make another file or can I use the same as the URL's?
Distribution: Slackware 11, Solaris 10, Solaris 9, Sourcemage 0.9.6
Posts: 322
Original Poster
Rep:
Thanks a lot! The script now reads the config file without problems.
But I got a different problem now:
The script is supposed to download and unpack archives, but when it unpacks I get this error:
Code:
bzip2: Compressed file ends unexpectedly;
perhaps it is corrupted? *Possible* reason follows.
bzip2: Inappropriate ioctl for device
Input file = (stdin), output file = (stdout)
It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.
You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.
tar: Child returned status 2
tar: Error exit delayed from previous errors
Soryy, but:
how am I supposed to know?
You did not post your script.
You did not describe what steps are taken.
You did not post the exact command with parameters that led to the error?
Do you Think I'm psychic? :-))
Distribution: Slackware 11, Solaris 10, Solaris 9, Sourcemage 0.9.6
Posts: 322
Original Poster
Rep:
I resolved the unpacking problem. Everything is fine. The problem was that it saved at least 10 copies of the same file and then it couldn't unpack them correctly. Anyway you have been great help thank you a lot.
Distribution: Slackware 11, Solaris 10, Solaris 9, Sourcemage 0.9.6
Posts: 322
Original Poster
Rep:
I resolved the unpacking problem. Everything is fine. The problem was that it saved at least 10 copies of the same file and then it couldn't unpack them correctly. Anyway you have been great help thank you a lot.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.