Phacocaster: OK, thank you for the explanation (and thanks to @dtgreene too). For the script, i don't really know... Goes to /proc directory and displays the kmem file before exiting ?
No, it doesn't actually do that.
You see, the first line of the script is
#!/bin/cat
This line of the script is telling the kernel that the script is to be interpreted by the cat program. Therefore, when you try to execute it (via a command like "./script.sh" after setting the executable bit), the kernel will run the cat program on the script, which will just output the script without executing the commands in it.
So, the actual output of this script, when executed, is the same as the script. Or, in other words, the output is
#!/bin/cat
cd /proc
cat kmem
exit 1
and it will exit successfully (despite the "exit 1" command).
Now, if you instead explicitly run it through the shell (like with "bash script.sh"), then it will try to display the /proc/kmem file, and will likely display an error message before ending in failure.