I am trying to pass a to fill an array with a list of directories using a simple shell script. However when I pass
/bin/*
$1
/bin/bash
*
#!/bin/bash
declare -a d
placeholder=0
for filename in ${1}; do
d[${placeholder}]=${filename:5}
((placeholder++))
done
echo "$1"
/bin/bash
*
is being expanded by the shell before it calls your script. Try calling as yourscript '/bin/*'
(note the quotes).