Help with a Bash script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm quite new to Bash scripting, and just need a little pointer on how
to go through a file, and execute commands there in until the end of the
file is reached.

The idea is this, a list of iptables rules is downloaded, they are run
through a set of commands to get the file in a state ready to run. I
need to read each line of that file, and execute each one. I'm not sure
on loops in bash, and hope someone can help... :)

I download this file:
http://www.okean.com/antispam/iptables/rc.firewall.china

Then run it through this to sanitize it
sed 's/--dport 25//g' rc.firewall.china|cat|grep "^[ ]*iptables" >
rc.firewall.china_mod

Now, how do I loop through that file executing each line in a for while
loop?

- -- 
Michael
http://maverickapollo.wordpress.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJLvfD5AAoJEEcwpNahApVBDB0IAICTmuZu16K/1P14lUeG4NKP
Sg07LgM1qYW3JLDjVrBnfJ8CE7qtmTwx4GB6WjiNthbJ1LLDmOyg8tQ11sgYKG7E
grOSSSKXXy37bKV4UtPStQgkTUu4UVGNjd6L7/8KlG0YLk9jgSbcSzO0svke/9eP
oYgiz4brRm+MAtHVDDefqrKfJe2bO9B8F1WXRJqDLMIlvHJAP2Rvc36xdGOlAtRT
WS8UVrso2yLjAAm2QK2P3gVvPBe6YlC+1buLyb2/kyRngg9FIZbq6pP8QevwHK6T
8yoWKecPTlrom8xU+1Gj3njcUOqwBDvpv4Rc2WQAw+adnPTU9XwgN/jMb17A4Mc=
=pjO5
-----END PGP SIGNATURE-----
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux