0
I have a scirpt like this:
#!/bash/bin
file=`cat /proc/net/arp`
echo $file
And when I run the script it outputs the whole folder where the script is like this:
IP address HW type Flags HW address Mask Device 192.168.1.102 0x1 0x2 a0:88:b4:e3:f6:6c naloga1.png naloga1.txt naloga1.txt~ naloga2.png naloga2.txt naloga2.txt~ naloga3.png naloga3.sh naloga3.sh~ naloga3.txt naloga3.txt~ naloga4.png naloga4.txt naloga5.png naloga5.sh naloga5.sh~ naloga5.txt naloga6.png naloga6.txt naloga6.txt~ naloga7.png naloga7.txt naloga7.txt~ naloga8.sh naloga8.sh~ porocilo.odt tekst.txt tekst.txt~ eth0 192.168.1.1 0x1 0x2 58:6d:8f:15:fd:c3 naloga1.png naloga1.txt naloga1.txt~ naloga2.png naloga2.txt naloga2.txt~ naloga3.png naloga3.sh naloga3.sh~ naloga3.txt naloga3.txt~ naloga4.png naloga4.txt naloga5.png naloga5.sh naloga5.sh~ naloga5.txt naloga6.png naloga6.txt naloga6.txt~ naloga7.png naloga7.txt naloga7.txt~ naloga8.sh naloga8.sh~ porocilo.odt tekst.txt tekst.txt~ eth0
Any idea why it is acting this way?
1Gordon just gave the answer before I finished mine. I got got one more thing to add: set -x. Start your script with the normal shebang line (
#!/usr/bin/env bash) and on the next line addset -x. This will show you debug information. – Hennes – 2013-04-13T15:39:19.953Copy-paste your scripts, do not rewrite them. It helps others to detect the real problem. I've never seen
/bash/bin. – ignis – 2013-04-14T15:01:42.940