Ah we need to pass an argument then, okay try this instead:

#/bin/bash
ls -D $1
$1 is the first passed argument string.

So then to execute the shell script you would do like:

./ld.sh /root

which would list hte directory contents of /root etc.

you wont be able to save to /bin unless you do it as root (sudo on ubuntu)