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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well, the script works for me. I suggest you test it by running it as unprivileged user and without using Sudo. (You usually do not want to execute a script with root rights that resides in a directory that is not owned by root anyway.) If that doesn't error out (apart from not being able to replace the configuration file or restart the service) then run as 'sudo /bin/bash -vx /home/user/3drop.list 2>&1 | nl | tee /home/user/3drop.list.txt'. Read "/home/user/3drop.list.txt". If that doesn't contain errors then it's not the script that's the problem. If it however does contain errors then attach the plain text file "/home/user/3drop.list.txt".
From what I see when searching the web on bash arrays there should be a set of square brackets somewhere in that line. Of coarse I am not much of a programmer and this is sh and not bash so I am guessing.
OK. I'll fire up a Debian box tomorrow and see (can't even remember which version it runs). The ls thing means something coreutils. Apparently "mh" stands for "Multi Hardlink" meaning your `dircolors -b` is missing a value for "mh" like ":mh=44;37:". See if you can
The script works OK on Squeeze and running '/bin/bash --version' returns "GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)".
So what's your Bash version?
dircolors: /home/kingbee/.dircolors:1: invalid line; missing second token
at the top of the screen. I had a mh=00 that I deleted and did re-login but that did not fix it. There is another entry that has only 1 token? but as it is not a duplicate I didn't want to just remove it. The beginning of the file
I fired up a Squeeze vm that I have and it runs the script ok. The vm has the same version of bash as what you reported. I did notice that the blocked-host file that is generated only contains the data from edrop.txt and "not" the data from drop.txt Of the two I would think the data from drop.txt would be more important to have. I did have to create a dummy directory and file in /etc/arno-iptables-firewall to get it to complete without error.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.