On Fri, 04 Nov 2005 01:25:05 +0100, Marcio Cordero wrote:
> I'm using the following:
> x=`ifconfig |grep -A 1 eth1 | grep inet |column -t -s: |awk {'print $3'}`
>
> And then:
> if [ "$x" = "192.168.0.*" ]; do
> ...
> but I'm not sure this works.
Guessing NOT.
> How can I find out if it's working
put it in a file, chmod +x filename_here
Add a line after if like
echo "It worked"
save and exit, then do a
../filename_here
to debug, you can add a
set -xv
as frist/second line of script.
set -
as last line of script you want to watch.
For extra points, read
! bash script introduction documentation
http://tldp.org/LDP/intro-linux/html/index.html
! bash script advanced documentation
http://tldp.org/LDP/abs/html/index.html