Enviado em 20/06/2008 - 14:14h
high@high-desktop:~$ sudo bash -xv script.sh
Password:
#!/bin/bash
LISTAGEM=$(/sbin/ifconfig | grep eth | cut -c1-4)
/sbin/ifconfig | grep eth | cut -c1-4
++ /sbin/ifconfig
++ grep eth
++ cut -c1-4
+ LISTAGEM='eth0
eth1
eth1'
CONTADOR=0
+ CONTADOR=0
eths=
+ eths=
for i in ${LISTAGEM}
do
AUX_SPEED=$(/usr/sbin/ethtool ${i} | grep Speed | cut -d':' -f2 |cut -d' ' -f2)
eths[${CONTADOR}]="${i} conexão de ${AUX_SPEED}"
echo ${eths[${CONTADOR}]}
CONTADOR=$((CONTADOR+1))
done
+ for i in '${LISTAGEM}'
/usr/sbin/ethtool ${i} | grep Speed | cut -d':' -f2 |cut -d' ' -f2
++ /usr/sbin/ethtool eth0
++ grep Speed
++ cut -d: -f2
++ cut '-d ' -f2
+ AUX_SPEED=100Mb/s
+ eths[${CONTADOR}]='eth0 conexão de 100Mb/s'
+ echo eth0 $'conex\303\243o' de 100Mb/s
eth0 conexão de 100Mb/s
+ CONTADOR=1
+ for i in '${LISTAGEM}'
/usr/sbin/ethtool ${i} | grep Speed | cut -d':' -f2 |cut -d' ' -f2
++ /usr/sbin/ethtool eth1
++ grep Speed
++ cut -d: -f2
++ cut '-d ' -f2
+ AUX_SPEED=10Mb/s
+ eths[${CONTADOR}]='eth1 conexão de 10Mb/s'
+ echo eth1 $'conex\303\243o' de 10Mb/s
eth1 conexão de 10Mb/s
+ CONTADOR=2
+ for i in '${LISTAGEM}'
/usr/sbin/ethtool ${i} | grep Speed | cut -d':' -f2 |cut -d' ' -f2
++ /usr/sbin/ethtool eth1
++ grep Speed
++ cut -d: -f2
++ cut '-d ' -f2
+ AUX_SPEED=10Mb/s
+ eths[${CONTADOR}]='eth1 conexão de 10Mb/s'
+ echo eth1 $'conex\303\243o' de 10Mb/s
eth1 conexão de 10Mb/s
+ CONTADOR=3
high@high-desktop:~$ sudo sh script.sh
script.sh: 14: Syntax error: Bad substitution
Password:
#!/bin/bash
LISTAGEM=$(/sbin/ifconfig | grep eth | cut -c1-4)
/sbin/ifconfig | grep eth | cut -c1-4
++ /sbin/ifconfig
++ grep eth
++ cut -c1-4
+ LISTAGEM='eth0
eth1
eth1'
CONTADOR=0
+ CONTADOR=0
eths=
+ eths=
for i in ${LISTAGEM}
do
AUX_SPEED=$(/usr/sbin/ethtool ${i} | grep Speed | cut -d':' -f2 |cut -d' ' -f2)
eths[${CONTADOR}]="${i} conexão de ${AUX_SPEED}"
echo ${eths[${CONTADOR}]}
CONTADOR=$((CONTADOR+1))
done
+ for i in '${LISTAGEM}'
/usr/sbin/ethtool ${i} | grep Speed | cut -d':' -f2 |cut -d' ' -f2
++ /usr/sbin/ethtool eth0
++ grep Speed
++ cut -d: -f2
++ cut '-d ' -f2
+ AUX_SPEED=100Mb/s
+ eths[${CONTADOR}]='eth0 conexão de 100Mb/s'
+ echo eth0 $'conex\303\243o' de 100Mb/s
eth0 conexão de 100Mb/s
+ CONTADOR=1
+ for i in '${LISTAGEM}'
/usr/sbin/ethtool ${i} | grep Speed | cut -d':' -f2 |cut -d' ' -f2
++ /usr/sbin/ethtool eth1
++ grep Speed
++ cut -d: -f2
++ cut '-d ' -f2
+ AUX_SPEED=10Mb/s
+ eths[${CONTADOR}]='eth1 conexão de 10Mb/s'
+ echo eth1 $'conex\303\243o' de 10Mb/s
eth1 conexão de 10Mb/s
+ CONTADOR=2
+ for i in '${LISTAGEM}'
/usr/sbin/ethtool ${i} | grep Speed | cut -d':' -f2 |cut -d' ' -f2
++ /usr/sbin/ethtool eth1
++ grep Speed
++ cut -d: -f2
++ cut '-d ' -f2
+ AUX_SPEED=10Mb/s
+ eths[${CONTADOR}]='eth1 conexão de 10Mb/s'
+ echo eth1 $'conex\303\243o' de 10Mb/s
eth1 conexão de 10Mb/s
+ CONTADOR=3
high@high-desktop:~$ sudo sh script.sh
script.sh: 14: Syntax error: Bad substitution