Click to See Complete Forum and Search --> : script question...
UltraMaroon
12-08-2000, 05:12 PM
I want to make a bash script with the line "echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all" but if I did that wouldn't it just output "1 >/proc/sys/net/ipv4/icmp_echo_ignore_all"? how do I make it so it reads the command as a command and not a string to be displayed?
twofoolish2b
12-08-2000, 08:36 PM
Try something like this:
#!/bin/bash
/proc/sys/net/ipv4/icmp_echo_ignore_all
Make sure that you make the script executable with "chmod 755 script_name.sh". It should work.
klamath
12-08-2000, 08:54 PM
Well, the hash-bang at the top of the script should refer to /bin/sh, not bash -- there's no point making it less portable for no benefit.
You'd also need echo - /proc/ files are not meant to be executed. So the script would be this:
#!/bin/sh
echo 1 > /proc/foo/bar/baz
Change the /proc line to whatever setting you want to change.
------------------
- Klamath
Get my GnuPG Key Here (http://klamath.dyndns.org/mykey.asc)
Looking for an open source project to contribute to? Check out the Better Bulletin Board (http://bbb.sourceforge.net)